sromku / android-simple-facebook

[Deprecated] Simple Facebook SDK for Android
Other
878 stars 349 forks source link

Get Response Object after publish #431

Closed mahmoud-elnaggar closed 8 years ago

mahmoud-elnaggar commented 8 years ago

when I use publish method , sdk return only post id ` private void publishImpl(Publishable publishable, final OnPublishListener onPublishListener) {

    AccessToken accessToken = sessionManager.getAccessToken();
    GraphRequest request = new GraphRequest(accessToken, mTarget + "/" + publishable.getPath(), publishable.getBundle(), HttpMethod.POST, new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse response) {
            FacebookRequestError error = response.getError();
            if (error != null) {
                Logger.logError(GetAction.class, "Failed to publish", error.getException());
                if (onPublishListener != null) {
                    onPublishListener.onException(error.getException());
                }
            } else {
                if (response.getRawResponse() == null) {
                    Logger.logError(GetAction.class, "The response GraphObject has null value. Response=" + response.toString(), null);
                } else {
                    if (onPublishListener != null) {
                        JSONObject jsonObject = response.getJSONObject();
                        String id = jsonObject.optString("id");
                        onPublishListener.onComplete(id);
                    }
                }
            }
        }
    });
    request.setVersion(configuration.getGraphVersion());
    GraphRequestAsyncTask task = new GraphRequestAsyncTask(request);
    task.execute();
}`

Is there any way I can get all returned JSON Object ?