Facebook App Invite not received

懵懂的女人 提交于 2019-12-10 23:58:33

问题


I'm trying to send a facebook invite for my iOS application, but it never seems to get there and I can't figure out why. Here is the code I'm using:

-(void)inviteFriend:(NSString *)facebookId {

NSDictionary *parameters = @{ @"to": facebookId };
[FBWebDialogs
 presentRequestsDialogModallyWithSession:nil
 message:[NSString stringWithFormat:@"You've received an invite to my game!"]
 title:nil
 parameters:parameters
 handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
 {
     if(error)
     {
         NSLog(@"Some errorr: %@", [error description]);
         UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Invitiation Sending Failed" message:@"Unable to send inviation at this Moment, please make sure your are connected with internet" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
         [alrt show];
     }
     else
     {
         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];
         }

     }
 }friendCache:nil];

}

The console output appears like it is sending:

[FacebookManager inviteFriend:]_block_invoke [Line 288] Request ID: 766594713370919 [FacebookManager inviteFriend:]_block_invoke [Line 293] Recipient ID(s): ( correct User ID here )

but when I log in to that facebook user via my iOS device, there is no notification.

The question appears to be a duplicate of a couple others, but neither have answers: Facebook setting for Invite friend in Facebook Code for fb invitation not working

Thanks.


回答1:


Have set the iOS setting on Facebook app account ?

Note that the notification is only available at Mobile device only (NOT ON WEB BROWSER).

Facebook developer basic settings



来源:https://stackoverflow.com/questions/23659932/facebook-app-invite-not-received

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!