gpt4 book ai didi

ios - FBSDKShareDialog 在应该发布时取消

转载 作者:技术小花猫 更新时间:2023-10-29 10:17:11 24 4
gpt4 key购买 nike

我在代码中创建了一个 FBSDKShareDialog

- (void)shareWithFacebookDialog;
{
FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"Path Redacted"];
content.contentTitle = @"Title Redacted";
content.contentDescription = @"Description Redacted";

FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
[dialog setMode:FBSDKShareDialogModeNative];
[dialog setShareContent:content];
[dialog setDelegate:self];
[dialog setFromViewController:self];
[dialog show];
}

对话框启动并且所有信息都是正确的

enter image description here

但是只要点击“发布”,对话框就会关闭并调用取消委托(delegate)。

- (void)sharerDidCancel:(id<FBSDKSharing>)sharer;

有人看过吗?找到克服它的方法了吗?

最佳答案

用这个替换你的代码

- (void)shareWithFacebookDialog;
{
FBSDKShareLinkContent content = [[FBSDKShareLinkContent alloc]init];
content.contentURL = [NSURL URLWithString:@"https://www.google.com"];
content.contentTitle = @"ContentTitle";
content.contentDescription = @"ContentDescription";
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:self];
}

告诉我它是否有效。

关于ios - FBSDKShareDialog 在应该发布时取消,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31076154/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com