Facebook iOS SDK 4.X - 如何发送“应用程序请求”

时间:2015-06-19 18:30:31

标签: ios facebook facebook-ios-sdk sharekit

Facebook 3.X

 [FBWebDialogs presentRequestsDialogModallyWithSession:nil
                                                      message:[NSString stringWithFormat:@"Discover celebrities in real life."]
                                                        title:nil
                                                   parameters:nil
                                                      handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                                          if (error) {
                                                              // Case A: Error launching the dialog or sending request.
                                                              NSLog(@"Error sending request.");
                                                          } else {
                                                              if (result == FBWebDialogResultDialogNotCompleted) {
                                                                  // Case B: User clicked the "x" icon
                                                                  NSLog(@"User canceled request.");
                                                              } else {
                                                                  NSLog(@"Request Sent.");
                                                              }
                                                          }}];

Facebook 4.X文档说FBWebDialogs“被强类型对话框取代。请参阅FBSDKGameRequestDialog,FBSDKAppGroupAddDialog,FBSDKAppGroupJoinDialog。”

我正在考虑初始化FBSDKAppGroupJoinDialog,但这是怎么做的,有例子吗?

1 个答案:

答案 0 :(得分:0)

FBSDKAppGroupJoinDialog *appGroupJoinDialog = [[FBSDKAppGroupJoinDialog alloc] init];
appGroupJoinDialog.delegate = self;
appGroupJoinDialog.groupID = groupID;  // <-- this is the group ID to join
[appGroupJoinDialog show];