iosfacebookfacebook-sdk-3.0facebook-requests

iOS : No Notification Received from Facebook App Request


I have to integrate app request on my app but it doesn't seem to work. I searched about it and I can't find a clear answer. Some replies from the reports said that the request can be found in Facebook App Center but I didn't receive any request and also, no notification was received.

I'm using Facebook SDK for iOS v3.8 to send the request. There's no error and there's a request, it was always successful but still no notification.

Here is the code I'm using to send the request.

- (void)sendAppInvite:(NSString *)message {
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"app_non_users", @"filters", nil];

    [FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession] message:message title:nil parameters:params handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
        if (error) {
            // Case A: Error launching the dialog
            NSLog(@"Error on app invite.");
        } else {
            if (result == FBWebDialogResultDialogNotCompleted) {
                // Case B: User clicked the "x" icon
                NSLog(@"User canceled app invite");
            } else {
                // Case C: Dialog shown and the user clicks Cancel or Share
                NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
                if (![urlParams valueForKey:@"request"]) {
                    // User clicked the Cancel button
                    NSLog(@"User canceled app invite");
                } else {
                    // User clicked the Send button
                    NSString *postID = [urlParams valueForKey:@"request"];
                    NSLog(@"Request successful: %@", postID);
                }
            }
        }
    }];
}

I also tried to build the sample app from Facebook, I sent an invite. Still, no notification and no request from the app center.

Is there something that I'm doing wrong? Also, is there a bug from Facebook Request?

Thanks!


Solution

  • Only apps that are actually on facebook.com can use the Notifications API. Note this is different than "app requests". In other words, you can't get your app to post a notification in the top right corner where the globe is.