gpt4 book ai didi

ios - FBSDKShareDialog shareFromViewController 方法在哪里

转载 作者:行者123 更新时间:2023-12-01 17:38:47 25 4
gpt4 key购买 nike

下载最新的 Facebook SDK 并遵循文档:

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://developers.facebook.com"];
[FBSDKShareDialog shareFromViewController:self
withContent:content
delegate:nil];

但是有一个问题,没有 shareFromViewController 方法!
只有showFromViewController方法,不能做share工作,share方法在哪里?

最佳答案

SDK中没有shareFromViewController方法用于分享,是showFromViewController方法用于分享。

[FBSDKShareDialog showFromViewController:self
withContent:tempContent
delegate:self];

或者
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.delegate=self;
shareDialog.fromViewController = self;
shareDialog.shareContent = content;
[shareDialog show];

//委托(delegate)方法
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results{

}
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer{

}

- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error{
NSLog(@"%@",error);
}

关于ios - FBSDKShareDialog shareFromViewController 方法在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30208665/

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