Iphone 集成ShareKit应用程序iOS时出错
我想在我的项目中使用shareKit应用程序,但当我试图在facebook上发布图像时,我遇到了这个错误Iphone 集成ShareKit应用程序iOS时出错,iphone,objective-c,ios,sharekit,Iphone,Objective C,Ios,Sharekit,我想在我的项目中使用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。您不
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
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];
}];
以下是发布到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];
}];
您没有使用最新版本。最新版本为:
如果您仅在iOS6上使用Facebook、Twitter或SinaWeibo,直接使用social.network确实更简单。此错误出现在哪里?它是哪个文件?使用最新版本的sharekit:)我已经下载了最新版本version@lakesh当我登录facebook时。不,它在iOS5中不起作用。对于iOS5,您应该实现共享工具包。不,这仅适用于iOS 6。但这让事情变得容易多了问题是我没有失败