繁体   English   中英

新的Facebook iOS SDK发布与对话框一起提供

[英]New Facebook iOS SDK posting to feed with dialog

新的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中的等效功能是什么

它看起来与您所拥有的非常相似。 从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/

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM