TSShareHelper icon indicating copy to clipboard operation
TSShareHelper copied to clipboard

iOS11下不可用

Open X-my opened this issue 6 years ago • 14 comments

iOS11下,用SLComposeViewController分享到微信和QQ没效果,SLComposeViewController根本出不来,控制台打印:

2017-09-26 13:32:44.689141+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController initWithServiceType: com.tencent.xin.sharetimeline 2017-09-26 13:32:44.689293+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController initWithServiceType got extension (null) for identifier com.tencent.xin.sharetimeline 2017-09-26 13:32:44.689348+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController initWithExtension: (null) requestedServiceType: (null) 2017-09-26 13:32:44.690192+0800 ShareMorePicToWX[14387:5256590] [core] addImage start 2017-09-26 13:32:44.690247+0800 ShareMorePicToWX[14387:5256590] [core] addImage start 2017-09-26 13:32:44.690289+0800 ShareMorePicToWX[14387:5256590] [core] addImage start 2017-09-26 13:32:44.690329+0800 ShareMorePicToWX[14387:5256590] [core] addImage start 2017-09-26 13:32:44.690369+0800 ShareMorePicToWX[14387:5256590] [core] addImage start 2017-09-26 13:32:44.699862+0800 ShareMorePicToWX[14387:5256590] [core] viewWillAppear 2017-09-26 13:32:44.705108+0800 ShareMorePicToWX[14387:5256590] [core] viewDidAppear 2017-09-26 13:32:44.706422+0800 ShareMorePicToWX[14387:5256590] [core] ViewDidAppear, but remote VC failed, dismissing 2017-09-26 13:32:44.706860+0800 ShareMorePicToWX[14387:5256590] [core] Sheet not being presented, calling premature completion 2017-09-26 13:32:44.706905+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController completeWithResult: 0 2017-09-26 13:32:44.706978+0800 ShareMorePicToWX[14387:5256590] 点击了取消 2017-09-26 13:32:44.707063+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController automatically dismissing itself 2017-09-26 13:32:44.711762+0800 ShareMorePicToWX[14387:5256590] [core] SLComposeViewController dealloc <SLComposeViewController: 0x157d35d30>

用UIActivityViewController选微信或者QQ也不行,控制台打印:

2017-09-26 13:22:27.622056+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController initWithExtension: <NSExtension: 0x1c01768c0> {id = com.tencent.xin.sharetimeline} requestedServiceType: (null) 2017-09-26 13:22:27.625187+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController addExtensionItem: <NSExtensionItem: 0x1c0016610> - userInfo: { NSExtensionItemAttachmentsKey = ( "<NSItemProvider: 0x1c00acd20> {types = (\n "public.image"\n)}", "<NSItemProvider: 0x1c00ac9c0> {types = (\n "public.image"\n)}", "<NSItemProvider: 0x1c00a8e20> {types = (\n "public.image"\n)}" ); } 2017-09-26 13:22:28.166303+0800 ShareMorePicToWX[14100:5244368] [core] viewWillAppear 2017-09-26 13:22:28.166416+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController including 1 explicit NSExtensionItems 2017-09-26 13:22:28.166471+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController about to instantiate remote view controller with array of 1 NSExtensionItems 2017-09-26 13:22:28.168405+0800 ShareMorePicToWX[14100:5244368] [core] viewDidAppear 2017-09-26 13:22:28.433143+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController finished instantiate remote view controller (null) error Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.tencent.xin.sharetimeline.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named com.tencent.xin.sharetimeline.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.} extension request identifier (null) 2017-09-26 13:22:28.433213+0800 ShareMorePicToWX[14100:5244368] [core] HOST: Failed to load remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.tencent.xin.sharetimeline.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named com.tencent.xin.sharetimeline.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.} 2017-09-26 13:22:28.441385+0800 ShareMorePicToWX[14100:5244368] [core] Sheet not being presented, calling premature completion 2017-09-26 13:22:28.441408+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController completeWithResult: 0 2017-09-26 13:22:28.442141+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController skipping explicit dismiss because isBeingDismissed is already 1 2017-09-26 13:22:28.442503+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController completeWithResult: 0 2017-09-26 13:22:28.442519+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController skipping explicit dismiss because isBeingDismissed is already 1 2017-09-26 13:22:28.443633+0800 ShareMorePicToWX[14100:5244368] [core] SLComposeViewController dealloc <SLComposeViewController: 0x1060439c0>

X-my avatar Sep 26 '17 05:09 X-my

更新ios11之后据说系统的权限出问题了,正在想办法整改, 您也可以参与进来帮我适配ios11.这个问题目前还没找到解决方案,并且我查看了淘宝联盟,发现他们的分享也不可以

TsnumiDC avatar Sep 26 '17 11:09 TsnumiDC

不知道是不是微信的内置分享没有适配iOS11的原因,网上没查到相关的信息,我暂时改成用SDK了。 https://stackoverflow.com/questions/44879798/about-slcomposeviewcontroller-in-ios-11-beta 这个链接里说Twitter在iOS11不再支持内置分享,不知道微信什么的能不能支持,等等看吧。

X-my avatar Sep 28 '17 02:09 X-my

https://forums.developer.apple.com/message/262706#262706

TsnumiDC avatar Sep 28 '17 02:09 TsnumiDC

官方论坛的帖子也有在问,我会及时跟进,尽快找到解决方案并更新,非常抱歉

TsnumiDC avatar Sep 28 '17 02:09 TsnumiDC

现在这方面的资料好少,没有找到解决方案,求大神解决

yanlang avatar Sep 29 '17 14:09 yanlang

同问题路过。ios11不在支持了。尴尬!

Amberler avatar Oct 11 '17 05:10 Amberler

又遇到这个问题了,还是没有解决办法。SLComposeViewController automatically dismissing itself

CoderKingXY avatar Nov 17 '17 07:11 CoderKingXY

试了一下,如果弹不出来的话,需要主vc拿一个presentvc的强引,这个问题就不存在了

stackJolin avatar Dec 25 '17 12:12 stackJolin

@stackJolin 你是iOS11么,我这边iOS11这样也不可以

sunnysuhappy avatar Jan 04 '18 10:01 sunnysuhappy

@sunnysuhappy 跟很多情况有关,有的越狱机型也不行,我现在的处理方式是拿了一个activity的强引,目前没有出现这个问题了

stackJolin avatar Jan 06 '18 08:01 stackJolin

@stackJolin 可以分享一下代码吗,弄了好久都不可以

jenifer001 avatar Jan 09 '18 02:01 jenifer001

@stackJolin 同求如何实现 试了不可以跳过选择直接分享到微信~

kingsword avatar May 16 '18 12:05 kingsword

有没有好的解决方法?

weipeng02 avatar May 23 '18 06:05 weipeng02

iOS11确实好坑,楼主的这个demo一直蹦,你们可以试试这个https://github.com/100apps/openshare

zhangkun0625 avatar Jun 11 '18 07:06 zhangkun0625