Note that there are some explanatory texts on larger screens.

plurals
  1. POPermissions Error - Trying to get friends using android facebook sdk
    primarykey
    data
    text
    <p>I am trying to add a feature to my android app that allows users to "checkin" with other people tagged to the checkin. I have the checkins method working no problem and can tag some one by adding the user ID as a parameter (see code below)</p> <pre><code>public void postLocationTagged(String msg, String tags, String placeID, Double lat, Double lon) { Log.d("Tests", "Testing graph API location post"); String access_token = sharedPrefs.getString("access_token", "x"); try { if (isSession()) { String response = mFacebook.request("me"); Bundle parameters = new Bundle(); parameters.putString("access_token", access_token); parameters.putString("place", placeID); parameters.putString("Message",msg); JSONObject coordinates = new JSONObject(); coordinates.put("latitude", lat); coordinates.put("longitude", lon); parameters.putString("coordinates",coordinates.toString()); parameters.putString("tags", tags); response = mFacebook.request("me/checkins", parameters, "POST"); Toast display = Toast.makeText(this, "Checkin has been posted to Facebook.", Toast.LENGTH_SHORT); display.show(); Log.d("Tests", "got response: " + response); if (response == null || response.equals("") || response.equals("false")) { Log.v("Error", "Blank response"); } } else { // no logged in, so relogin Log.d(TAG, "sessionNOTValid, relogin"); mFacebook.authorize(this, PERMS, new LoginDialogListener()); } } catch(Exception e) { e.printStackTrace(); } } </code></pre> <p>This works fine (I've posted it in case it is of help to anyone else!), the problem i am having is i am trying to create a list of the users friends so they can select the friends they want to tag. I have the method getFriends (see below) which i am then going to use to generate an AlertDialog that the user can select from which in turn will give me the id to use in the above "postLocationTagged" method.</p> <pre><code>public void getFriends(CharSequence[] charFriendsNames,CharSequence[] charFriendsID, ProgressBar progbar) { pb = progbar; try { if (isSession()) { String access_token = sharedPrefs.getString("access_token", "x"); friends = charFriendsNames; friendsID = charFriendsID; Log.d(TAG, "Getting Friends!"); String response = mFacebook.request("me"); Bundle parameters = new Bundle(); parameters.putString("access_token", access_token); response = mFacebook.request("me/friends", parameters, "POST"); Log.d("Tests", "got response: " + response); if (response == null || response.equals("") || response.equals("false")) { Log.v("Error", "Blank response"); } } else { // no logged in, so relogin Log.d(TAG, "sessionNOTValid, relogin"); mFacebook.authorize(this, PERMS, new LoginDialogListener()); } } catch(Exception e) { e.printStackTrace(); } } </code></pre> <p>When i look at the response in the log it reads:</p> <p>"got responce: {"error":{"type":"OAuthException", "message":"(#200) Permissions error"}}"</p> <p>I have looked through the graphAPI documentation and searched for similar questions but to no avail! I'm not sure if i need to request extra permissions for the app or if this is something your just not allowed to do! Any help/suggestions would be greatly appreciated.</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.
    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