Facebook App引发iOS集成错误

时间:2015-12-25 13:41:44

标签: ios objective-c facebook-ios-sdk

当我尝试使用以下代码打开Facebook App邀请时,我的应用崩溃了原因:-[NSTaggedPointerString containsObject:]: unrecognized selector sent to instance

FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://fb.me/565305550289696"];
//optionally set previewImageURL
content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://www.google.co.in/logos/doodles/2015/holidays-2015-day-3-6399865393250304.2-res.png"];

// present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
[FBSDKAppInviteDialog showFromViewController:shareAlertController withContent:content delegate:self];

我做了Facebook开发者网站上提到的所有设置,也创建了适当的Applink。

出现此错误的原因是什么?

1 个答案:

答案 0 :(得分:2)

我在数据类型的信息plist中添加了LSApplicationQueriesSchemes键。只需右键单击Info.plist打开源代码即可。并在其中添加以下代码。

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>