Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 集成ShareKit应用程序iOS时出错_Iphone_Objective C_Ios_Sharekit - Fatal编程技术网

Iphone 集成ShareKit应用程序iOS时出错

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。您不

我想在我的项目中使用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

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。但这让事情变得容易多了问题是我没有失败