Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just call <code>publishStory(StringYouNeed,StringYouNeed,StringYouNeed);</code> And implement this in your activity / Fragment :</p> <pre><code>private void publishStory(String hash, String title, String user) { Session session = Session.getActiveSession(); if (session != null){ // Check for publish permissions List&lt;String&gt; permissions = session.getPermissions(); if (!isSubsetOf(PERMISSIONS, permissions)) { pendingPublishReauthorization = true; Session.NewPermissionsRequest newPermissionsRequest = new Session .NewPermissionsRequest(getActivity(), PERMISSIONS); session.requestNewPublishPermissions(newPermissionsRequest); return; } Bundle postParams = new Bundle(); postParams.putString("name", title); postParams.putString("caption", "bla bla"); postParams.putString("description", "bla bla"); postParams.putString("link", "http://blabla.com/"+hash); Request.Callback callback= new Request.Callback() { public void onCompleted(Response response) { JSONObject graphResponse = response .getGraphObject() .getInnerJSONObject(); String postId = null; try { postId = graphResponse.getString("id"); } catch (JSONException e) { Log.i(TAG, "JSON error "+ e.getMessage()); } FacebookRequestError error = response.getError(); if (error != null) { debug.print("erreur"); } } }; Request request = new Request(session, "me/feed", postParams, HttpMethod.POST, callback); RequestAsyncTask task = new RequestAsyncTask(request); task.execute(); } } private boolean isSubsetOf(Collection&lt;String&gt; subset, Collection&lt;String&gt; superset) { for (String string : subset) { if (!superset.contains(string)) { return false; } } return true; } </code></pre> <p>Works perfect for me, hope this help.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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