little-snow-fox / react-native-wechat-lib

🚀 WeChat login, share, favorite and payment for React-Native on iOS and Android
MIT License
670 stars 130 forks source link

安卓端分享图片报错 #149

Open hehepeng opened 3 years ago

hehepeng commented 3 years ago

static shareToWX(index, item) { console.log('wechat: ', WeChatRN) let img = 'https://google.com/1.jpg' WeChatRN.isWXAppInstalled() .then((isInstalled) =>{ if (isInstalled) { console.log('掉微信') WeChatRN.shareImage({ scene: 0, imageUrl: img, }).catch((error) => { console.log('error: ', error) Toast.message(error.message) }) } else { Toast.message("没有安装微信,请安装微信后再试") } }) }

TypeError: nativeShareImage is not a function at D:\programs\ltApp\node_modules\react-native-wechat-lib\index.js:256 at tryCallTwo (D:\programs\ltApp\node_modules\react-native\node_modules\promise\setimmediate\core.js:45) at doResolve (D:\programs\ltApp\node_modules\react-native\node_modules\promise\setimmediate\core.js:200) at new Promise (D:\programs\ltApp\node_modules\react-native\node_modules\promise\setimmediate\core.js:66) at Object.shareImage (D:\programs\ltApp\node_modules\react-native-wechat-lib\index.js:255) at _callee$ (D:\programs\ltApp\src\utils\Wechat.js:49) at tryCatch (D:\programs\ltApp\node_modules\regenerator-runtime\runtime.js:63) at Generator.invoke [as _invoke] (D:\programs\ltApp\node_modules\regenerator-runtime\runtime.js:293) at Generator.next (D:\programs\ltApp\node_modules\regenerator-runtime\runtime.js:118) at tryCatch (D:\programs\ltApp\node_modules\regenerator-runtime\runtime.js:63)