Reputation: 23
I have a problem with the integration of the Facebook deep linking (from a article to my app). I followed the documentation (https://developers.facebook.com/docs/applinks) step by step, there is nothing to do, it doesn't work..
So in my website, I add the metadata :
<meta property="fb:app_id" content="...">
<meta property="al:ios:url" content="appname://event?event_id=127">
<meta property="al:ios:app_name" content="app name">
In my app delegate :
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
BFURL *parsedUrl = [BFURL URLWithInboundURL:url sourceApplication:sourceApplication];
if ([parsedUrl appLinkData]) {
// this is an applink url, handle it here
NSURL *targetUrl = [parsedUrl targetURL];
[[[UIAlertView alloc] initWithTitle:@"Received link:"
message:[targetUrl absoluteString]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
}
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];}
Did you have any idea why my app wasn't open ? I also configure my Facebook app settings.
Upvotes: 1
Views: 1455
Reputation: 4281
Change <meta property="al:ios:url" content="appname://event?event_id=127">
to
<meta property="al:ios:url" content="myApp://event?event_id=127">
Your app will recognize the scheme set by your url which is the myApp in this case (You can change it your desired string but both should match). So this should be present in your app's plist to recognize the incoming call to open.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myApp</string>
<string>fbXXXXXXXXXXXXXXXX</string>
</array>
</dict>
</array>
Upvotes: 1