【发布时间】: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 中打开我的应用 深层链接不起作用。 谁能告诉我这还缺少什么?
【问题讨论】:
-
参考 *.com/questions/32643522/… 和 *.com/questions/33290566/… 确保您传递正确的 URL。
-
不是
<string>abcevent://</string>,是<string>abcevent</string> -
你能显示你的plist吗
-
@Anbu.Karthik 这是我的 Plist := imagebin.ca/v/3Pv0QBFGn4rL
-
@Niharika - 你是否改变了字符串
标签: ios objective-c facebook deep-linking