chell
chell

Reputation: 7866

How to identify a user who accepts a notification request

With the New Facebook Request Object only one ID is given.

If a User invites many friends using the Multi Friend Finder only one request id is given.

Then when the invited user goes to their Facebook page and accepts the request the same request id is used.

Now I can't identify who this user is as all the invited users have the same request id.

How can I access the ID of the user?

Update:

I understand that I have to ask the user to authorize my application. I have the following code to determine if the user has already authorized my application:

FB.init
          (
              {
                  appId   : "<%=APPLICATION_ID%>",
                  status  : true,
                  cookie  : true,
                  oauth   : true
              }
          );

          FB.getLoginStatus(function(response) {
          if (response.status === 'connected') {
            // the user is logged in and connected to your
            // app, and response.authResponse supplies
            // the user's ID, a valid access token, a signed
            // request, and the time the access token 
            // and signed request each expire
        alert('connected');
            var uid = response.authResponse.userID;
            var accessToken = response.authResponse.accessToken;
        alert(uid)
          } else if (response.status === 'not_authorized') {
            alert('notconnected');
            // the user is logged in to Facebook, 
            //but not connected to the app
        **//here need to get authorization for the application**
          } 
         });

How do I get the authorization dialogue box to come up in Facebook?

Upvotes: 0

Views: 625

Answers (1)

Juicy Scripter
Juicy Scripter

Reputation: 25918

You should ask him to connect with your application.

You can however get the information about request itself using application access_token to know all the users request was sent to...

BTW, Requests are no longer removed once user accepts 'em, so you'll be able to pull all the requests user have after authorization and remove those requests.

Update:
You can get user identity by asking him authorize your application once landed to your application with request_id passed, this can be done using OAuth Dialog or FB.login method of JS-SDK (see authentication guide for more details).

As stated by Facebook Officials on BUG #202883726463009:

If a developer needs to clear out an outstanding request, they can use the UID they receive when sending the request, as returned in the JavaScript callback or Graph API response. Otherwise the Request will naturally timeout and be cleared automatically.

Upvotes: 1

Related Questions