Note that there are some explanatory texts on larger screens.

plurals
  1. POTag friend in wallpost with Android Facebook sdk
    text
    copied!<p>I'm trying to tag a friend in a wallpost using the android facebook sdk. However, what is supposed to be the tag, is blank, nothing. This is the code I've used:</p> <pre><code> Bundle params = new Bundle(); access_token = fb.getAccessToken(); try { params.putString("format", "json"); params.putString("access_token", access_token); String url = "https://graphs.facebook.com/me/friends"; String response = Util.openUrl(url, "GET", params); JSONObject json = Util.parseJson(response); JSONArray array = json.optJSONArray("data"); for(int i = 0; i &lt; array.length(); i++) { String tempName = array.getJSONObject(i).getString("name"); String tempID = array.getJSONObject(i).getString("id"); //Probably should have some if-tests here if(tempName.contains(*nameOfFriend*)) { Bundle bundle = new Bundle(); bundle.putString("message", "App tagging test"); //this is where the tagging is supposed to happen bundle.putString("tags", *UserID*); try { fb.request("me/feed", bundle, "POST"); Toast.makeText(getApplicationContext(), "Tag-test", Toast.LENGTH_SHORT).show(); } catch (MalformedURLException e) { Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show(); e.printStackTrace(); } catch (IOException e) { Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } else { Toast.makeText(getApplicationContext(), "Couldn't find friend", Toast.LENGTH_SHORT).show(); } } } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p>I've only granted the permission for "publish_stream", could it be that I need other permissions? Thanks in advance for any help, guys!</p>
 

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