Parth Pandya
Parth Pandya

Reputation: 1490

Facebook App invites iOS integration error

When I try to open Facebook App invite using below code, my app crashes with reason: -[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];

I did all setup mentioned on Facebook Developer websites, also created proper Applink.

What can be the reason for this error?

Upvotes: 1

Views: 327

Answers (1)

Parth Pandya
Parth Pandya

Reputation: 1490

I added LSApplicationQueriesSchemes key in info plist with array type. Just right click Info.plist and Open as Source code. And add below code in it.

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

Upvotes: 2

Related Questions