Search code examples
iosfacebookfacebook-ios-sdk

Checking for Facebook requests in iOS game


I am planning on implementing send gift to Facebook friend via requests.

Sending and receiving gift(clicking on the request from the Facebook app) works fine.

But i would like to know is there a way to get the list of all pending requests for the user so i can present them with gift screen without user having to open app throughout Facebook notification.

Similar to this:Pending gifts screen from requests overview


Solution

  • After some digging i found the right Graph API.

    To get all pending request you simply use /me/apprequests

    [FBRequestConnection startWithGraphPath:@"/me/apprequests"
                                 parameters:nil
                                 HTTPMethod:@"GET"
                          completionHandler:^(
                              FBRequestConnection *connection,
                              id result,
                              NSError *error
                          ) {
                              /* handle the result */
                          }];