2013-02-19 105 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"); 
    }]; 

希望這有助於。

相關問題