iosfacebook-graph-apiapprequestsfacebook-app-requestsfacebook-invite

IOS fb invites sent but not shown on users wall


I am sending requests from my app to the fb friends but i am not getting any notification on the wall of fb user whom i sent request ?

I am using FB SDK 3.2 (i hope its the latest)

Following is the code i am using to send request

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     friendList, @"to",
                                     nil];
    [FBWebDialogs presentRequestsDialogModallyWithSession:nil
        message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", 15]
        title:@"Total Smashed Score"
        parameters:params
        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.");
                }
            }
        }
     ];

The request dialog is properly shown, when i click send button the invites are sent but not shown on the users wall. Any type of help will be appreciated.

Regards.


Solution

  • Here is my solution

    //friendlist = NSString of fb id's
    
    NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                         friendList, @"to",
                                         nil];
        [FBWebDialogs presentRequestsDialogModallyWithSession:nil
            message:[NSString stringWithFormat:@"message!"]
            title:@"title"
            parameters:params
            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 {
                        NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
                        if (![urlParams valueForKey:@"request"]) {
                            // User clicked the Cancel button
                            NSLog(@"User clicked cancel button.");
                        } else {
                            nslog("succesfully sent invites");
                        }
                    }
                }
            }
         ];