Update: I'm using Facebook version 48.0 and iOS 9.2.1
I have been struggling with Facebook-sharing and deep linking into my app on iOS9 for a couple of days now, and I just can't get my app to automatically launch when tapping on shared content.
Everything seem to work as expected on iOS8.
All I see when I tap a shared content is a blank page in the Facebook's own webview. Under the "Share"-button in the top-right corner I have options for opening the link in safari, and for opening my app. Both these options will actually open the app. But what I want is to be prompted to open my app directly.
The thing is that this actually works when I share my url from a browser. The difference is that that one is a link-share, while the one I'm trying to share from my app is an open-graph share.
I am aware of similar questions (like this one), but none of the answers has worked for me. Probably because my setup is a bit different.
My setup:
Sharing to Facebook works, but I've included my sharing-code for the sake of completion. I'm sharing a FBSDKShareOpenGraphContent using FBSDKShareDialog like this:
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.fromViewController = self.parentViewController;
NSDictionary *properties = @{@"fb:app_id": <fb_app_id>, @"og:type": @"video.other", @"og:locale": @"sv_SE", @"og:url": <url_to_applink_host>, @"og:title": @"Title", @"og:description": @"my description", @"og:image": <image_url>};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
// Create an action
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"video.watches";
[action setObject:object forKey:@"video"];
// Create the content
FBSDKShareOpenGraphContent *ogContent = [[FBSDKShareOpenGraphContent alloc] init];
ogContent.action = action;
ogContent.previewPropertyName = @"video";
shareDialog.shareContent = [self getFBContentWithProperties:mutableProperties];
shareDialog.delegate = self;
shareDialog.mode = FBSDKShareDialogModeNative;
if (![shareDialog canShow]) {
shareDialog.mode = FBSDKShareDialogModeFeedBrowser;
}
[shareDialog show];
The url used for the content points to a generated website that looks like this:
<html>
<head>
<meta property="al:ios:url" content="myappscheme://?type=series&contentId=61b768777300eb6e&providerId=3" />
<meta property="al:ios:app_store_id" content="<app_store_id>" />
<meta property="al:ios:app_name" content="MyApp" />
<meta property="al:web:should_fallback" content="false" />
</head>
</html>
And finally this is what my plist file looks like:
...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myappscheme</string>
<string>fbAppIdScheme</string>
</array>
</dict>
</array>
...
<key>FacebookAppID</key>
<string>12345</string>
<key>FacebookDisplayName</key>
<string>MyAppName</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
...
I feel there must be something obvious I'm missing, or is it that the facebook's webview is broken?
Any hints or guidance is welcome!
UPDATE
Here is an example link: http://shared.streamler.tv/f883439972d67d733e2c855b1ce224c6d4b1c727