Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to retrieve access token for facebook on real device
    primarykey
    data
    text
    <p>I did Facebook integration in my project, everything is fine on emulator. When it comes to run on real device it is not working. I think the problem is Facebook access token, I don't know what to do now? So I am unable to retrieve friends information on real device. Can anybody help me how to get access token on real device.</p> <p>I am using Android SDK only to get the Facebook friends information.</p> <pre><code>mFacebook = new Facebook("api_id"); mFacebook.authorize(this, new String[] { "publish_stream", "read_stream", "offline_access", "friends_birthday", "user_birthday", "email", "read_friendlists", "manage_friendlists" }, this); sToken = mFacebook.getAccessToken(); public void onComplete(Bundle values) { Log.e("oncomplete", "value"); if (values.isEmpty()) { Log.e("oncomplete", "value is empty"); return; } if (!values.containsKey("POST")) { sToken = mFacebook.getAccessToken(); getFriends() } } private void getFriends() { try { sToken = mFacebook.getAccessToken(); StaticUtils.sResponseId = mFacebook.request("me/friends"); Log.w("response", StaticUtils.sResponseId); try { JSONObject jObj = Util.parseJson(StaticUtils.sResponseId); JSONArray jArr = jObj.getJSONArray("data"); for (int i = 0; i &lt; jArr.length(); i++) { JSONObject jObjFren = jArr.getJSONObject(i); Iterator it = jObjFren.keys(); while (it.hasNext()) { String s = (String) it.next(); // Log.w("KEY",s); String sname = jObjFren.getString(s); if (s.equals("id")) { StaticUtils.sFbId.add(sname); StaticUtils.sFbPics.add(StaticUtils.sImgUrl + sname + "/picture"); } else if (s.equals("name")) { StaticUtils.sFbName.add(sname.toLowerCase()); } } } } catch (JSONException e) { Log.w("json exception", e.toString()); } catch (FacebookError e) { Log.w("facebook exception", e.toString()); } } catch (MalformedURLException e) { Log.w("malformed exception", e.toString()); } catch (IOException e) { Log.w("io exception", e.toString()); } } </code></pre> <p>Thanks, Ammu</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload