React-native-wechat: rn0.30 react-native-wechat1.5.3

Created on 5 Aug 2016  ·  10Comments  ·  Source: yorkie/react-native-wechat

                WeChat.shareToSession({
                    title:'微信测试链接',
                    description: '分享自:111',
                    type: 'news',
                    webpageUrl: 'http://mm.baidu.com',
                    thumbImage:‘http://www.atsec.cn/cn/pci-attestation/Baidupay-PCIAttestation-atsec-PCI-DSS-C-47271.jpg',
                })

写了thumbImage直接闪退,不写可以分享成功,请问下什么是原因

bug ios

Most helpful comment

这个问题我是这样解决的,在文件RCTWeChat.m中有这行代码:
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:aData[RCTWXShareTypeThumbImageUrl]];

修改为
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:aData[RCTWXShareTypeThumbImageUrl]]]
就可以了。

All 10 comments

觉得图片有问题,但是换了个小的thumbImage:'http://ds.cdncache.org/avatar-50/532/164695.jpg' 也一样

刚刚又在Android上测了下,是可以的,ios还是闪退

我测试看看!

好的,谢谢

+1

遇到相同问题,请尽快解决,谢谢!

目前怀疑是因为 iOS SDK 版本过老导致的问题,因为 iOS9 强制使用 http2 而目前使用的 SDK 使用的是 http/1.1

这个问题我是这样解决的,在文件RCTWeChat.m中有这行代码:
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:aData[RCTWXShareTypeThumbImageUrl]];

修改为
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:aData[RCTWXShareTypeThumbImageUrl]]]
就可以了。

试了下楼上的方法解决了,github大法好

Fixed at #97

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunny20131314 picture sunny20131314  ·  6Comments

phpsmarter picture phpsmarter  ·  5Comments

eulo picture eulo  ·  4Comments

Vinkugor picture Vinkugor  ·  4Comments

qubangliuhui picture qubangliuhui  ·  5Comments