Facebook iOS SDK 4.X - How to send "App Requests"

282 views Asked by At

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 documentation says that FBWebDialogs "is replaced by strongly typed dialogs. See FBSDKGameRequestDialog, FBSDKAppGroupAddDialog, FBSDKAppGroupJoinDialog."

I'm looking at initializing FBSDKAppGroupJoinDialog but how is this done, is there an example?

1

There are 1 answers

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