0

I am using the beneath code from Facebook sdk. The problem is that the dialog opens up in UIWebView. I can see that there is a native dialog, but why is my code open UIWebView? I have the native Facebook App installed on the device.

FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://www.example.com/myapplink"];
//optionally set previewImageURL
content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://www.example.com/my_invite_image.jpg"];

// present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
[FBSDKAppInviteDialog showWithContent:content
                             delegate:self];
Chris G.
  • 23,930
  • 48
  • 177
  • 302

1 Answers1

0

Since the new Facebook SDK, that was optimised for iOS 9, Facebook is using the preferred SafariViewController, this is why it opens in the Safari. This is now the preferred option (according to Facebook) and will not change.

The SDK will try to minimize the frequency of this by choosing the best dialog available (such as SafariViewController), but this is by design in iOS 9.

From their guide : Preparing Your Apps for iOS9

Eli Braginskiy
  • 2,867
  • 5
  • 31
  • 46