在连接Facebook中的错误ios 6

在连接Facebook中的错误ios 6

问题描述:

我已经使用Facebook Graph和FBConnect文件为ios 4实施了Facebook墙贴。它在ios 4和ios 5设备中工作正常,但现在不影响任何内容。在连接Facebook中的错误ios 6

但是,当我试图连接在iOS 6设备的Facebook,它给了我一个错误,如下图所示。 enter image description here

我已经搜索了这个,但无法获得解决方案。

谢谢。

你必须使用苹果的API iOS6的,请阅读以下链接https://developers.facebook.com/docs/howtos/ios-6/

使用可以使用下面的代码为iOS6的

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) { 
      if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { 
       SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; 
       SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){ 
        if (result == SLComposeViewControllerResultCancelled) { 
         NSLog(@"Cancelled"); 
        } else 
        { 
         NSLog(@"Done"); 
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Successfully Posted On Facebook" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
         [alert show]; 
         [alert release]; 
        } 
        [controller dismissViewControllerAnimated:YES completion:Nil]; 
       }; 
       controller.completionHandler =myBlock; 
       [controller setInitialText:@"Test Message"]; 
       // [controller addURL:[NSURL URLWithString:@"http://www.mobile.safilsunny.com"]]; 
       // [controller addImage:[UIImage imageNamed:@"fb.png"]]; 
       [self presentViewController:controller animated:YES completion:Nil]; 
      } 
      else{ 
       NSLog(@"UnAvailable"); 
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Facebook Accounts" message:@"There are no Facebook accounts configured.You can add or create a Facebook account in Settings" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
       [alert show]; 
       [alert release]; 
      } 

在iOS6的Facebbok整合是非常容易的,苹果包括Facebook功能在iOS6,所以使用苹果API更好的性能。

在脸谱 “http://developers.facebook.com/”

应用开放应用>>您的应用程序设置>> >>编辑设置>>高级>>迁移>>禁止所有破变更

试试这个它会工作。