Reputation: 311
I am using Facebook iOS SDK v4.1 in iOS application. Application is in Development State. I am trying to invite Facebook friends to share Application. I am following This Document.
Kindly check following crashing log for the same.
2015-12-03 16:30:20.888 xyz[8055:160402] +[FBSDKAppInviteDialog showFromViewController:withContent:delegate:]: unrecognized selector sent to class 0x24a85c 2015-12-03 16:30:20.923 xyz[8055:160402] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FBSDKAppInviteDialog showFromViewController:withContent:delegate:]: unrecognized selector sent to class 0x24a85c'
My Code:
FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://fb.me/MyAppID"];
//optionally set previewImageURL
content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://www.example.com/image.jpg"];
// present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
[FBSDKAppInviteDialog showFromViewController:self withContent:content delegate:self];
Upvotes: 3
Views: 318
Reputation: 9912
That is an issue on your end. The method showFromViewController
was introduced in v4.6 of the Facebook iOS SDK but as you are using v4.1 this method does not exist in the SDK.
You should upgrade to the most recent version of the Facebook SDK for iOS (v4.8 as of now) and then it should work fine.
Upvotes: 1