gpt4 book ai didi

facebook-ios-sdk - 如何 [FBDialogs canPresentShareDialogWithParams :nil] works?

转载 作者:行者123 更新时间:2023-12-04 04:52:46 24 4
gpt4 key购买 nike

有没有人让 [FBDialogs canPresentShareDialogWithParams:nil] 正常工作?
它总是返回我NO。我应该在 params 中放入什么?

    if ([FBDialogs canPresentShareDialogWithParams:nil]) {
NSURL* url = [NSURL URLWithString:@"http://www.google.fr"];
[FBDialogs presentShareDialogWithLink:url
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
} else {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *fbComposer = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[fbComposer setInitialText:@"Google rocks !"];
[self presentViewController:fbComposer animated:YES completion:nil];
} else {
[[[UIAlertView alloc] initWithTitle:@"Informations" message:@"You have to be registered into the settings of your phone in order to share" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil] show];
}
}

最佳答案

根据 SDK 中的 HelloFacebookSample(以及我自己的经验!):

FBShareDialogParams *p = [[FBShareDialogParams alloc] init];
p.link = [NSURL URLWithString:@"http://developers.facebook.com/ios"];
BOOL canShareFB = [FBDialogs canPresentShareDialogWithParams:p];

canShareFB 将返回 如果 Facebook 应用程序 已安装 在系统中;返回 如果 没有 Facebook 应用程序被发现。

关于facebook-ios-sdk - 如何 [FBDialogs canPresentShareDialogWithParams :nil] works?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17197117/

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