I currently have a problem with my iOS application because I don't seem to be able to send requests to people... Here is the code that I have:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:nil];
if([FBSession activeSession].isOpen) {
[FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession] message:@"Join me." title:@"Invite" parameters:params handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
NSLog(@"%@", [FBSession activeSession]);
if (error)
NSLog(@"Error sending request.");
else {
if (result == FBWebDialogResultDialogNotCompleted)
NSLog(@"User canceled request.");
else if(result == FBWebDialogResultDialogCompleted)
NSLog(@"Request: %@", resultURL);
else
NSLog(@"Error unknown.");
}
}];
}
else {
[FBSession openActiveSessionWithReadPermissions:@[@"email"] allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if(session.isOpen) {
[FBSession openActiveSessionWithPublishPermissions:@[@"publish_actions"] defaultAudience:FBSessionDefaultAudienceEveryone allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if(session.isOpen) {
[self showRequestForFacebook];
}
}];
}
}];
}
Every time I get a I get a request ID but nothing on the account. I looked at the sample in the Facebook SDK and I seem to have exactly the same. However, it works with the sample and not with my code.
Is there anything to change somewhere? Is it something on developers.facebook.com?Request: (null)
.
Edit: I forgot to say that in the same application I use a SLComposeViewController to share on Facebook and it works perfectly.
Thanks a lot! :)
}