No result displayed in retrieving User data in facebook iFrame application using users_getInfo() -


I am writing a PHP iframe / facebook connect application with a PHP client library and in one of the pages, retrieve me The user's current location, either the city or the country

$ user_id = $ facebook- & gt; Need_login ($ required_emptive = 'user_location, publish_stream, email, read_stream, user_about_me, user_activities, user_birthday, user_hometown, user_interests, user_likes, user_status);

This is the code I am using in my application,

  $ userInfo = $ facebook-> API_climate-> User_getienfo ($ user_id, array ('current location')); Var_dump ($ userInfo); $ Location = ($ userInfo [0])? $ UserInfo [0] ['current_location']: $ user INFO ['current_location']; Echo "UserInfo:". $ Location;  

The result of var_dump ($ userInfo) is string (0) "" and the echo of $ space is empty.

Please help someone please help me.

That's because you generated an error while copying the example. You have wrong method signing.

  // Your Version $ facebook-> API_climate-> User_getInfo ($ user_id, 'last_name', 'first_name'); // example $ facebook-> API_climate-> User_getienfo ($ uid, 'last_name, first_name');  

See the difference? This is only two criteria - the second area has a comma-separated list of names.

Therefore, since you are not requesting the field correctly from the API, this response is not available.

So the error is when trying to read it.


Comments