-1

I tried to using Request.newUploadPhotoRequest to upload the picture and tag my friends.

    Request photoRequest = Request.newUploadPhotoRequest(session, bitmap,
            callback);
    Bundle params = photoRequest.getParameters();
    params.putString("message", "I am using AffectiveHealth App");
    params.putStringArray("tags", selectedUsersTag);
    photoRequest.setParameters(params);
    photoRequest.executeAsync();

The codes are able to upload the picture and show the message on facebook wall.However,I cannot tag my friends and there are no any errors from the response of facebook.

I would like to find a solution. plz help me Thanks a lot Thank you guys.

1 Answer 1

1

When you upload a photo, you're posting to the me/photos graph endpoint. The me/photos endpoint does not support tagging, see the documentation here: https://developers.facebook.com/docs/reference/api/user/#photos

If you want to tag people, it's a 2 step process. First you need to upload the photo using the mechanism you're already using. Then in the response, you'll get the ID of the photo, and you can then use the ID/tags endpoint to tag people. See the documentation here: https://developers.facebook.com/docs/reference/api/photo/#tags

2
  • it seems make sense. I will try to implement it. Thank you. Nov 20, 2013 at 22:56
  • I used String photo_ID = (String)response.getGraphObject().getProperty("id"); to obtain photoID from response in the uploadphoto's Callback, then in the for loop, String inputParm = uploadResponse + "/tags?to=" + friends_Id.get(i); params.putString("tags", friends_Id.get(i)); and lanch a new request such like : Request request = new Request(null, inputParm, params, HttpMethod.POST, null); but it still not work very well. Nov 21, 2013 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.