gpt4 book ai didi

ios - FBSDKShareDialog 崩溃 : [__NSCFString scheme]

转载 作者:行者123 更新时间:2023-11-29 10:25:15 28 4
gpt4 key购买 nike

执行这段代码时

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = viewController;
dialog.shareContent = content;
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.delegate = self;
[dialog show];

应用程序在 [dialog show] 崩溃;使用此堆栈跟踪:

0   CoreFoundation                      0x2b9effa7 <redacted> + 150
1 libobjc.A.dylib 0x3a0a0c8b objc_exception_throw + 38
2 CoreFoundation 0x2b9f53a9 <redacted> + 0
3 CoreFoundation 0x2b9f32c7 <redacted> + 714
4 CoreFoundation 0x2b922ba8 _CF_forwarding_prep_0 + 24
5 uCiC 0x003cf1ef +[FBSDKInternalUtility isBrowserURL:] + 22
6 uCiC 0x0044c9f5 +[FBSDKShareUtility _validateNetworkURL:name:error:] + 64
7 uCiC 0x0044b17d +[FBSDKShareUtility validateShareLinkContent:error:] + 176
8 uCiC 0x0044ad71 +[FBSDKShareUtility validateShareContent:error:] + 284
9 uCiC 0x004433ad -[FBSDKShareDialog validateWithError:] + 84
10 uCiC 0x004431c5 -[FBSDKShareDialog show] + 36
11 uCiC 0x002028c7 -[ICSocialSharer fbSharingInAppWebViewContent:inViewController:] + 306
12 uCiC 0x002031f5 -[ICSocialSharer fbSharingForPostModel:inViewController:] + 2316
13 uCiC 0x00203549 -[ICSocialSharer postMessageForModel:socialNetwork:inViewController:] + 568
14 uCiC 0x000ea2e5 -[PostFotoViewController postSocial:] + 1528
15 UIKit 0x2f0a2c4b <redacted> + 70
16 UIKit 0x2f0a2bf1 <redacted> + 44
17 UIKit 0x2f08d7e3 <redacted> + 582
18 UIKit 0x2f0a265d <redacted> + 588
19 UIKit 0x2f0a2337 <redacted> + 522
20 UIKit 0x2f09bc11 <redacted> + 544
21 UIKit 0x2f071e05 <redacted> + 196
22 UIKit 0x2f2e86fb <redacted> + 14414
23 UIKit 0x2f070819 <redacted> + 1352
24 CoreFoundation 0x2b9b5d8f <redacted> + 14
25 CoreFoundation 0x2b9b519f <redacted> + 218
26 CoreFoundation 0x2b9b3805 <redacted> + 772
27 CoreFoundation 0x2b8fff31 CFRunLoopRunSpecific + 476
28 CoreFoundation 0x2b8ffd43 CFRunLoopRunInMode + 106
29 GraphicsServices 0x333da201 GSEventRunModal + 136
30 UIKit 0x2f0d1879 UIApplicationMain + 1440
31 uCiC 0x0010d07d main + 108
32 libdyld.dylib 0x3a652aaf <redacted> + 2

原因是:'-[__NSCFString 方案]:无法识别的选择器发送到实例 0x187a8030'。

自从我们使用 iOS9 构建后就会发生这种情况。

现在,plist 包含适用于 FaceBookSDK 4.6 的正确方案,并且允许 AppTranspotPolicy。

你们知道如何解决这个问题吗?

谢谢,D.

最佳答案

显然 Facebook 不会检查内容 url 是否真的是 url,即使对象是 NSString,他们也会调用 [NSURL scheme]。

所以内容图片 url 是这样写的,编译器没有任何警告或问题:

content.imageURL = [sharedData valueForKey:@"link"];  //which is an NSString

然后把它变成这样的 NSURL

content.imageURL = [NSURL URLWithString:[sharedData valueForKey:@"link"]];

一切似乎都正常。

非常糟糕,因为编译器没有报错,但应用程序在运行时崩溃了。我还将在 Facebook 上提交错误。

PS:我在这里为任何遇到此问题的人写了这篇文章。

关于ios - FBSDKShareDialog 崩溃 : [__NSCFString scheme],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32743074/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com