php - Find Facebook global profile ID from app_scoped_user_id -
this has been asked plenty of times on stack overflow, answers explain how convert facebook profile id app_scoped_user_id
. asking opposite:
- i have
app_scoped_user_id
, provided facebook graph api. - i want global profile id, can output link user's facebook page.
here flow of php application:
- a facebook request made
/me
, returning facebook response - on response, call getgraphobject() return facebook graph object.
when authenticating own facebook account, contents of graph object:
array (size=11) 'id' => string '1117686364915316' (length=16) 'email' => string 'greg.bowler@g105b.com' (length=21) 'first_name' => string 'greg' (length=4) 'gender' => string 'male' (length=4) 'last_name' => string 'bowler' (length=6) 'link' => string 'https://www.facebook.com/app_scoped_user_id/1117686364915316/' (length=61) 'locale' => string 'en_gb' (length=5) 'name' => string 'greg bowler' (length=11) 'timezone' => int 1 'updated_time' => string '2015-06-23t10:12:53+0000' (length=24) 'verified' => boolean true
from this, need able provide link facebook account. can done knowing facebook account's id, buy going http://facebook.com/profile.php?id=xxxxx, redirect correct page if have named account.
however, id specified in graph object response not global facebook id; app_scoped_user_id
, specific application i'm authenticating with.
how can convert app_scoped_user_id
global id of account?
for example, website http://findmyfacebookpageid.com/ this, although source code closed.
i can provide app_scoped_user_id
service here: http://findmyfacebookpageid.com/get.php?url=https://www.facebook.com/app_scoped_user_id/1117686364915316
and returns:
{ facebook_id: "100000218905189" }
to prove question answerable, can use returned facebook_id
value access actual facebook page visiting http://facebook.com/profile.php?id=100000218905189
this question has been asked few times (get facebook user id facebook app scope id)
you should not able global id app-scoped id. facebook fixing every method there find it, considered "hacks".
since mentioned it, user's profile page there ways find global id fixed facebook in time too, if still interested, of answers (how find own facebook id? (not app-scoped id)) question might useful.
Comments
Post a Comment