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

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

launchMiniProgram正常,但shareMiniProgram连微信都拉不起来,报Wechat Api invoke returns false #116

Closed fanzhiri closed 3 years ago

fanzhiri commented 4 years ago

"react-native-wechat-lib": "1.1.23"

WeChat.isWXAppInstalled()
                .then((isInstalled) => {
                    if (isInstalled) {
                        WeChat.shareMiniProgram({
                            userName: 'gh_************',//这里
                            miniProgramType:0,// 正式版:0,测试版:1,体验版:2
                            title: '时而习之',
                            description: '温故知新',
                            webpageUrl: 'https://www.jiwenleishi.com',
                            thumbImageUrl: 'https://slako-buildqst.stor.sinaapp.com/user/23/2019/0220/20190220084832935.jpg',
                            path: '/pages/articlemd/articlemd?mdt=0&aid=2',
                            scene: 3
                        });
                        // WeChat.launchMiniProgram({
                        //     userName: 'gh_************',
                        //     miniProgramType:0,// 正式版:0,测试版:1,体验版:2
                        //     path: '/pages/articlemd/articlemd?mdt=0&aid=2',
                        // });
                    } else {
                        Alert.alert('请安装微信');
                    }
                });

不知道如何找问题突破口

fanzhiri commented 4 years ago

WeChat.shareText 也不行

Dustin120504 commented 3 years ago

我也遇到了,现在已经解决。原来shareMiniProgram,我也是吊不起微信,iOS需要配置两个地方,WeChat.registerApp 时要填写正确的universalLink,还有在info.plist里 LSApplicationQueriesSchemes,要添加weixinULAPI,不能只添加wechat和weixin,配置之后,亲测,可以吊起微信,分享小程序! 希望能帮助后来者~!

JohnSmith0602 commented 3 years ago

我也遇到了,现在已经解决。原来shareMiniProgram,我也是吊不起微信,iOS需要配置两个地方,WeChat.registerApp 时要填写正确的universalLink,还有在info.plist里 LSApplicationQueriesSchemes,要添加weixinULAPI,不能只添加wechat和weixin,配置之后,亲测,可以吊起微信,分享小程序! 希望能帮助后来者~!

就是这个原因,感谢!

Miluaaa commented 3 years ago

WeChat.shareText 也不行

LSApplicationQueriesSchemes添加了三个参数,universalLink也保持一致

WeChat.shareText可以 WeChat. shareMiniProgram还是Wechat Api invoke returns false

TZXZ commented 3 years ago

我是将weixinULAPI 写成了 weixinulapi😂

CruxCv commented 3 years ago

WeChat.shareText 也不行

LSApplicationQueriesSchemes添加了三个参数,universalLink也保持一致

WeChat.shareText可以 WeChat. shareMiniProgram还是Wechat Api invoke returns false

麻烦问下,最后怎么处理的呢?

fanzhiri commented 3 years ago

WeChat.shareText 也不行

LSApplicationQueriesSchemes添加了三个参数,universalLink也保持一致 WeChat.shareText可以 WeChat. shareMiniProgram还是Wechat Api invoke returns false

麻烦问下,最后怎么处理的呢?

scene设置为0,除了0,别的都不行