【发布时间】:2016-05-07 03:08:58
【问题描述】:
我在集成 Facebook 深层链接(从文章到我的应用程序)时遇到问题。我一步步跟着文档(https://developers.facebook.com/docs/applinks),没什么可做的,它不起作用..
所以在我的网站中,我添加了元数据:
<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">
在我的应用委托中:
- (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
];}
您知道为什么我的应用没有打开吗? 我还配置了我的 Facebook 应用设置。
【问题讨论】:
标签: ios facebook hyperlink deep-linking