1

我正在使用 Facebook iOS SDK 和 FBSDKShareLinkContent 与文本共享 url 和图像。共享时一切似乎都很好。但问题是分享后,打开了新的应用实例。已完成的一次分享仍然在后台打开。

我做错了什么吗?如何避免?

这是我用于共享的代码...

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentDescription = [[MusicPlayerHelper playerManager] getTextToShare];
content.contentURL = [NSURL URLWithString:[[MusicPlayerHelper playerManager] getURLToShare]];
content.imageURL=[NSURL URLWithString:[[MusicPlayerHelper playerManager] getImageURLToShare]];

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fbauth2://"]]){
    dialog.mode = FBSDKShareDialogModeNative;
}
else {
    dialog.mode = FBSDKShareDialogModeAutomatic; //or FBSDKShareDialogModeAutomatic
}

dialog.shareContent = content;
dialog.delegate = _delegate;
dialog.fromViewController = _delegate;
[dialog show];
4

0 回答 0