It just return undefined if wechat not installed
meooxx opened this issue · comments
superq commented
Is it possible to return a more specific message or error?
const res = await shareText({
text: 'text',
scene: NativeWechatConstants.WXSceneSession
}).catch(e=>{
console.log(e) // e == undefined
})
// res == undefined
ps: there's a mistake in your demonstrate
import {registerApp} from 'native-wechat';
useEffect(()=>{
// `registerApp` should accept a request-type argument
// the blow code causes the crash, It makes me almost give up
// and the right way is registerApp({appId:'wx964290141ebe9b7b'})
return registerApp('wx964290141ebe9b7b');
}, [])
Would you like to add some argument checks or catch errors in case of an app crash?
Héctor Chong commented
Sure, I'll try.