我想在我的项目中使用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。
答案 0 :(得分:1)
您不需要使用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];
}];
答案 1 :(得分:1)
您没有使用最新版本。最新版本为:ShareKit 2.0。
如果您使用Facebook,Twitter或新浪微博仅限iOS6 ,直接使用social.network真的会更直接。