jeudi 2 avril 2015

Android Facebook v4.0 Post Image and Text


JSONObject jsonObject = new JSONObject();
try {

jsonObject.put("picture", bitmap);
jsonObject.put("message","just a message");

} catch (JSONException e) {
e.printStackTrace();
}


GraphRequest graphRequest = GraphRequest.newPostRequest(AccessToken.getCurrentAccessToken(), "me/photos", jsonObject, new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse graphResponse) {

Log.d("", "------ graphResponse = " + graphResponse);

}
});


graphRequest.executeAsync();


And is returning



graphResponse = {Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 324, errorType: OAuthException, errorMessage: (#324) Requires upload file}}



Please in Json Object param what i need to pass?


thanks


Aucun commentaire:

Enregistrer un commentaire