2013-02-19 107 views

回答

2

要设置您的Xcode项目,请阅读Facebook developer site上的说明。

您可以创建/使用[FBSession openActiveSessionWithAllowLoginUI:YES];

要发布到你的时间表打开会话,你需要有写入权限授权:

[[FBSession activeSession] reauthorizeWithPublishPermissions:@[ @"publish_stream" ] defaultAudience:FBSessionDefaultAudienceEveryone completionHandler:^(FBSession *authSession, NSError *authError) { 

    // If auth was successful, create a status update FBRequest 
    if (!authError) { 
     FBRequest *postRequest = [FBRequest requestForPostStatusUpdate:@"Hello, world!"]; 

     [postRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { 

      // TODO: Check for success/failure here 

     }]; 
    } 

}]; 
1

试试这个:

[FBRequestConnection startForPostStatusUpdate:@"I've been through the storm, future, present and past.. Light as a feather, swift as a cat.. Clickety clack, clickety clack!!" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { 
     NSLog(@"posted"); 
    }]; 

希望这有助于。

相关问题