iOS Facebook app invite: error

怎甘沉沦 提交于 2019-12-10 18:27:50

问题


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

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.


回答1:


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




回答2:


If you haven't created an appLinkURL as @Rumin suggested in the comments, you can create them and make sure they work here https://developers.facebook.com/quickstarts/?platform=app-links-host.

When you have your app links ready, make sure you have your app working with the latest App Transport Security restrictions made in iOS 9 and also whitelisting the other Facebook apps, follow this link https://developers.facebook.com/docs/ios/ios9.



来源:https://stackoverflow.com/questions/32331116/ios-facebook-app-invite-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!