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

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

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

这是我目前的代码:

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

最佳答案 将其添加到您的代码中:

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];
点赞