Same as the title, what situation can use the getUser() function on facebook?
P.S. I am using facebook php sdk api.
Why I ask this question is because I found out that if I not place the website inside the facebook.com, then getUser() function will always return null or 0.
Is that true? getUser() function only work in the website which inside the facebook.com?
Thanks. Newbie of facebook
The
getUsermethod should return the active facebook user id if there’s enough data available to determinate that. This data can come from various places:<iframe>See the getUserFromAvailableData method for exact details, from a developer perspective the
getUser()will return the current facebook user’s id when the user is authenticated on facebook, and has your application installed/authorized. To achieve that see the documentation on login, for an external website, the best option is to use facebook’s javascript sdk’sloginmethod to get the data needed for the backend (stored in cookies).