1

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

Jigar
  • 1,801
  • 1
  • 14
  • 29

1 Answers1

0

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")));
Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58