新的Facebook iOS SDK发布以提供对话框

时间:2012-08-30 14:01:52

标签: ios facebook cocoa facebook-graph-api

新的facebook SDK已经用完了......

这在旧的SDK中用于状态共享

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Facebook SDK for iOS", @"name",
                               @"Build great social apps and get more installs.", @"caption",
                               @"The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps.", @"description",
                               @"https://developers.facebook.com/ios", @"link",
                               @"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png", @"picture",
                               nil];

// Invoke the dialog
[self.facebook dialog:@"feed" andParams:params andDelegate:self];

新SDK中的等价物

2 个答案:

答案 0 :(得分:3)

它与您所拥有的非常相似。从SDK指南:

self.postParams =
        [[NSMutableDictionary alloc] initWithObjectsAndKeys:
         @"https://developers.facebook.com/ios", @"link",
         @"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture",
         @"Facebook SDK for iOS", @"name",
         @"Build great social apps and get more installs.", @"caption",
         @"The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps.", @"description",
         nil];

发布消息不再需要委托,而是使用块:

   [FBRequestConnection startWithGraphPath:@"me/feed"
                             parameters:self.postParams
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

                          // Handle Success/Failure

                      }];

https://developers.facebook.com/docs/howtos/publish-to-feed-ios-sdk/

答案 1 :(得分:0)

您现在可能已找到答案,但是您是否已查看https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/