gpt4 book ai didi

iphone - iOS 集成 ShareKit App 出错

转载 作者:行者123 更新时间:2023-11-29 11:06:04 25 4
gpt4 key购买 nike

我想在我的项目中使用 shareKit 应用程序,但是当我尝试在 facebook 上发布图片时出现此错误。

Error: This endpoint has been deprecated. To temporarily enable it, you may disable the "august 2012" platform migration. It will be disabled permanently on August 1, 2012.

我正在使用最新的 SDK 或 ShareKit。

最佳答案

您不需要使用 ShareKit 来实现 Facebook 集成。使用新的 iOS 6 SLComposeViewController 发布到 Facebook

这是发布到 Facebook 的完整代码

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) //check if Facebook Account is linked
{
mySLComposerSheet = [[SLComposeViewController alloc] init];
mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[mySLComposerSheet setInitialText:[NSString stringWithFormat:@"Test",mySLComposerSheet.serviceType]];
[mySLComposerSheet addImage:yourimage]; //an image you could post
[self presentViewController:mySLComposerSheet animated:YES completion:nil];
}
[mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
NSString *output;
switch (result) {
case SLComposeViewControllerResultCancelled:
output = @"Action Cancelled";
break;
case SLComposeViewControllerResultDone:
output = @"Post Successfull";
break;
default:
break;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Facebook" message:output delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
}];

关于iphone - iOS 集成 ShareKit App 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13561008/

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