getting error in FBSDKAppInviteDialog (Error Domain=com.facebook.sdk.core Code=9 "(null)")

380 Views Asked by At

i have succesfully created AppId in facebook.developer.i also add urlscheme in info.plist file.

here is my code

var inviteDialog : FBSDKAppInviteDialog = FBSDKAppInviteDialog()
        if(inviteDialog.canShow()){
            let appLinkUrl:NSURL = NSURL(string: "https://fb.me/*******")!
            let previewImageUrl:NSURL = NSURL(string: "http://yourwebpage.com/preview-image.png")!

            let inviteContent:FBSDKAppInviteContent = FBSDKAppInviteContent()
            inviteContent.appLinkURL = appLinkUrl as URL!
            inviteContent.appInvitePreviewImageURL = previewImageUrl as URL!

            inviteDialog.content = inviteContent
            inviteDialog.delegate = self
            inviteDialog.show()
        }

does not show invite dialogue box getting error like

1

There are 1 best solutions below

0
Gurjinder Singh On

I faced the same problem. So, I downloaded the latest SDK and found that App Invites are no longer supported from Facebook SDK version 4.28 and above. I downloaded the latest SDK version 4.33.0 from developers site and when I opened FBSDKAppInviteDialog class and found that the below methods are deprecated and are written as below.

+ (instancetype)showFromViewController:(UIViewController *)viewController
                           withContent:(FBSDKAppInviteContent *)content
                              delegate:(id<FBSDKAppInviteDialogDelegate>)delegate
__attribute__ ((deprecated("App Invites no longer supported")));


/**

 - Warning:use showFromViewController:withContent:delegate: instead
 */
+ (instancetype)showWithContent:(FBSDKAppInviteContent *)content delegate:(id<FBSDKAppInviteDialogDelegate>)delegate
__attribute__ ((deprecated("use showFromViewController:withContent:delegate: instead")));