I'm using the Facebook sdk in my app. There is a screen where I want to send invite to my Facebook friends to join my app. I'm using the below code to do that and setting the parameter "app_non_users" in it so that among all my friends I want those who have not authorised my app. This code is working fine for me.
SBJSON *jsonWriter = [SBJSON new];
NSArray *filters = [NSArray arrayWithObject:@"app_non_users"];
NSString *filtersString = [jsonWriter stringWithObject:filters];
NSMutableDictionary* params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
@"invite", @"message",
@"Check this out", @"notification_text",
filtersString, @"filters",
@"Invite Friends", @"title",
nil];
[FBWebDialogs
presentRequestsDialogModallyWithSession:nil
message:@"App Invite"
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or sending the request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled request.");
[self actionBack:nil];
} else {
// Handle the send request callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User canceled request.");
[self actionBack:nil];
} else {
// User clicked the Send button
NSString *requestID = [urlParams valueForKey:@"request"];
NSLog(@"Request ID: %@", requestID);
NSLog(@"%@",resultURL);
}
}
}
}];
I got this response on success,
fbconnect://success?request=1530223140578996&to%5B0%5D=398672303626018
I extracted the "to" id from the above response which is "398672303626018" in the above case but that is not the actual Facebook user id of that user whom I invited. Actually his Facebook is this one "100004497541090". So my question is how can I get the Facebook user id of the invited user who has not previously authorised my app. Thanks in advance!