深度链接Facebook iOS-应用无法打开 [英] Deep Linking Facebook iOS - App don't open

查看:95
本文介绍了深度链接Facebook iOS-应用无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在整合Facebook深层链接(从文章到我的应用程序)时遇到问题。我一步步遵循了文档( https://developers.facebook.com/docs/applinks

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
        ];}

您是否知道为什么我的应用未打开?
我还配置我的Facebook应用程序设置。

Did you have any idea why my app wasn't open ? I also configure my Facebook app settings.

推荐答案

更改< meta属性= al:ios:url content = appname:// event?event_id = 127>

< meta property = al :ios:url content = myApp:// event?event_id = 127>

您的应用将识别由您的网址就是 myApp (在这种情况下,您可以更改它为所需的字符串,但两者都应该匹配)。因此,这应该出现在您应用的plist中,以识别打开的来电。

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>

这篇关于深度链接Facebook iOS-应用无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆