【问题标题】:Facebook Deep Linking is not opening the appFacebook 深度链接未打开应用程序
【发布时间】:2017-11-16 03:00:51
【问题描述】:

我在 Facebook 上分享我的帖子。我正在分享图片、内容 URL、描述。我正在使用此代码进行共享:

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = self;
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentTitle = APP_NAME;
content.contentDescription = text;
content.imageURL = [NSURL URLWithString:[[arrAllEvents valueForKey:@"flyer_image"]objectAtIndex:0]];
content.contentURL = url;
dialog.shareContent = content;
dialog.mode = FBSDKShareDialogModeFeedWeb;
[dialog show];

我已为https://developers.facebook.com 启用深度链接(新闻源链接启动此应用程序)选项。 我已经像这样添加了我的 Fbid 和 URLShema

<key>CFBundleURLSchemes</key>
            <array>
                <string>abcevent://</string>
                <string>fb1......</string>
            </array>

并在 appdelegate.m 中添加类似这样的代码

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url,NSError *error){
        if([[url scheme] isEqualToString:@"abcevent"])
        {
            [self callNewsletter:url];
        }
    }];

    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
    [FBSDKAppEvents activateApp];

}

现在,如果我通过应用程序在 fb 上分享我的帖子。该帖子点击未在 iPhone 中打开我的应用 深层链接不起作用。 谁能告诉我这还缺少什么?

【问题讨论】:

标签: ios objective-c facebook deep-linking


【解决方案1】:

fetchDeferredAppLink 方法仅适用于广告。它从未与在新闻提要上有机共享的链接一起使用。您可以从 Facebook in this blog post 了解更多关于深度链接的限制,但有两点需要了解:

  1. Facebook 从未支持非付费内容的延迟深层链接。
  2. Facebook 的 App Links 标准曾一度支持正常的深度链接(即如果应用程序已安装),但这在 iOS 上已经被打破了很长时间。

如果您想要这种功能,您需要一个单独的解决方案,例如 Branch.io(完全披露:我在 Branch 团队)。

【讨论】:

    最近更新 更多