php - FB Canvas app: Get request id -


a user has sent app request (using native fb.ui:apprequest). when friend opens notification ("xxx has invited app") url looks this:

https://apps.facebook.com/app_name/?fb_source=notification&   request_ids=the_request_id&ref=notif&app_request_type=user_to_user&   notif_t=app_request 

on page, webpage shown inside iframe.

previously, call: $_get['request_ids'] on page (inside iframe) request_id (why? because need track sent invite).

however, no longer works. have tried pretty everything.

according facebook docs, previous solution made use of correct one. see: https://developers.facebook.com/docs/games/requests#deleting (scroll bit down, php example)

have facebook removed feature? sad, , guess/hope not!

people have had similar questions (all suggest solution, no longer works):

is solution pass inviters user_id? (as suggested in retrieve user id of facebook app invitor). , if so, can retrieve it, when user clicks on notification?

edit:

i have tried use: exit(print_r($facebook->getsignedrequest(), true)); - outputs:

algorithm => hmac-sha256 issued_at => 1395696960 user =>     country => dk     locale => da_dk     age =>         min => 21 user_id => the_user_id (only when app has been authed seems) 

close, no cigar.

i've been looking solution quite while, , best make api call /me/apprequests - return requests app.

i know still can't figure out 1 you've clicked (in case received multiple invites), it's step ahead until fb sorts things...

simple js example:

fb.api('/me/apprequests', function(r){     if (r && r.data) {         (var = 0; < r.data.length; i++) {             var id = r.data[i].id.split('_')[0]; // request id             console.log(id, r.data[i]);         };     } }) 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -