Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Facebook中邀请好友的Facebook设置_Ios_Facebook_Facebook Graph Api - Fatal编程技术网

Ios Facebook中邀请好友的Facebook设置

Ios Facebook中邀请好友的Facebook设置,ios,facebook,facebook-graph-api,Ios,Facebook,Facebook Graph Api,这可能是一个简单的问题,但有人能告诉我吗 在Facebook开发者网站的应用程序中,我们需要为邀请朋友做什么设置吗 我已经做了所有的代码来邀请朋友 当我用邀请朋友的示例代码替换Facebook应用程序ID时,我的代码也可以正常工作 但是,当我替换我的应用程序ID时,过程会正常进行,成功地向我显示邀请消息,但邀请不会发送 我正在使用以下代码: [FBWebDialogs presentRequestsDialogModallyWithSession:nil

这可能是一个简单的问题,但有人能告诉我吗

在Facebook开发者网站的应用程序中,我们需要为邀请朋友做什么设置吗

我已经做了所有的代码来邀请朋友

当我用邀请朋友的示例代码替换Facebook应用程序ID时,我的代码也可以正常工作

但是,当我替换我的应用程序ID时,过程会正常进行,成功地向我显示邀请消息,但邀请不会发送

我正在使用以下代码:

[FBWebDialogs presentRequestsDialogModallyWithSession:nil
                                              message:FacebookInviteMessage
                                                title:@"Invite Friends"
                                           parameters:parameters
                                              handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {

                                                  NSString *strResultUrl = [resultURL absoluteString];

                                                  if (result == FBWebDialogResultDialogCompleted && ![strResultUrl isEqualToString:@"fbconnect://success"])
                                                  {
                                                      MIDLog(@"Web dialog complete: %@", resultURL);

                                                      if (![resultURL query])
                                                      {
                                                          return;
                                                      }

                                                      NSDictionary *params = [self parseURLParams:[resultURL query]];
                                                      NSMutableArray *recipientIDs = [[NSMutableArray alloc] init];
                                                      for (NSString *paramKey in params)
                                                      {
                                                          if ([paramKey hasPrefix:@"to["])
                                                          {
                                                              [recipientIDs addObject:[params objectForKey:paramKey]];
                                                          }
                                                      }
                                                      if ([params objectForKey:@"request"])
                                                      {
                                                          NSLog(@"Request ID: %@", [params objectForKey:@"request"]);
                                                      }
                                                      if ([recipientIDs count] > 0)
                                                      {
                                                          //[self showMessage:@"Sent request successfully."];
                                                          //NSLog(@"Recipient ID(s): %@", recipientIDs);
                                                          UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Invitation(s) sent successfuly!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
                                                          [alrt show];
                                                          alrt = nil;
                                                      }





                                                      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success" message:FacebookInviteSuccess delegate:self cancelButtonTitle:@"Proceed" otherButtonTitles:nil];
                                                      alert.tag = 14114;
                                                      [alert show];
                                                      alert = nil;

                                                  }

                                                  else if (result == FBWebDialogResultDialogCompleted && [strResultUrl isEqualToString:@"fbconnect://success"])
                                                  {
                                                      MIDLog(@"Cancel Clicked");

                                                      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cancelled" message:nil delegate:self cancelButtonTitle:@"Proceed" otherButtonTitles:nil];
                                                      alert.tag = 14114;
                                                      [alert show];
                                                      alert = nil;

                                                  }

                                                  else {
                                                      MIDLog(@"Web dialog not complete, error: %@", error.description);

                                                      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:InternetFailError delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                                                      alert.tag = 15115;
                                                      [alert show];
                                                      alert = nil;

                                                  }
                                              }
                                          friendCache:self.friendCache] 

我在Facebook开发者网站的应用程序设置中提供了canvas URL,它适合我