简体   繁体   English

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

[英]Facebook iOS SDK 4.X - How to send “App Requests”

Facebook 3.X 脸书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 documentation says that FBWebDialogs "is replaced by strongly typed dialogs. See FBSDKGameRequestDialog, FBSDKAppGroupAddDialog, FBSDKAppGroupJoinDialog." Facebook 4.X文档说FBWebDialogs “被强类型对话框取代。请参阅FBSDKGameRequestDialog,FBSDKAppGroupAddDialog,FBSDKAppGroupJoinDialog”。

I'm looking at initializing FBSDKAppGroupJoinDialog but how is this done, is there an example? 我正在查看初始化FBSDKAppGroupJoinDialog但是如何完成此操作,是否有示例?

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

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

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