1

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?

rptwsthi
  • 10,094
  • 10
  • 68
  • 109
Parth Pandya
  • 1,460
  • 3
  • 18
  • 34
  • You should try acting Exception breakpoint as mentioned in this answer: http://stackoverflow.com/a/17802942/656600 that will give you the exact like where it is crashing. Them may be we cab figure out what the problem is. – rptwsthi Dec 25 '15 at 15:22

1 Answers1

2

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>
Lucas Huang
  • 3,998
  • 3
  • 20
  • 29
Parth Pandya
  • 1,460
  • 3
  • 18
  • 34