iOS Facebook app invite: error

 

Questions


I have to implement Facebook invite in my iOS app.
I am following below reference link:
https://developers.facebook.com/docs/app-invites/ios

and
created app link as per below link:

https://developers.facebook.com/docs/applinks

I am facing below error:-

Error Domain=com.facebook.sdk.core Code=9 "The operation couldn’t be completed. (com.facebook.sdk.core error 9.)"

in below FBSDKAppInviteDialogDelegate delegate method

func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didFailWithError error: NSError!) {
    println("didFailWithError: (error)")

}

My plist setting is enter image description here

My code is as given below:

@IBAction func btnInviteClicked(sender: UIBarButtonItem) {
    var content: FBSDKAppInviteContent = FBSDKAppInviteContent()
    content.appLinkURL = NSURL(string: "https://fb.me/MyFacebookAppLinkURL")

    //Optional
    content.appInvitePreviewImageURL = NSURL(string: "AnyImageURL")
    FBSDKAppInviteDialog.showWithContent(content, delegate: self)
}

Pls suggest any solution, to show invite pop up and work successfully.

Thanks in advance.

 

 

————————————————-

Answer

Make sure you have [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; in your AppDelegate. I’ve spend two days while trying to fix that.

facebook-invite-friends,facebook-ios-sdk,facebook-sdk-4.x

Facebook Comments

Post a comment