没有深度链接到应用程序的FBSDKShareLinkContent

时间:2016-10-26 23:31:11

标签: ios facebook facebook-sdk-4.x

我使用FBSDKShareLinkContent显示一个对话框,用于分享指向Facebook的链接。无论我使用的链接(我甚至尝试使用https://google.com/)在Facebook应用程序中点击帖子/链接时,我的应用程序都会启动。

但是,我希望在Web浏览器或FB浏览器中加载链接(而不是让它启动我的应用程序或导航到应用程序商店)。反正有没有实现这个目标?我尝试了FBSDKShareDialogModeFeedWebFBSDKShareDialogModeAutomatic

这是我目前的代码:

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"https://google.com/"];

FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.shareContent = content;
dialog.fromViewController = self;
[dialog show];

1 个答案:

答案 0 :(得分:1)

将此添加到您的代码中:

FBSDKShareLinkContent *content1 = [[FBSDKShareLinkContent alloc] init];
content1.contentURL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Facebook"];
content1.contentTitle=@"Share";
[FBSDKShareDialog showFromViewController:self withContent:content1 delegate:nil];