Publish photos to friend's timeline

143 views
Skip to first unread message

P.Visakh Nair

unread,
May 13, 2014, 5:09:38 AM5/13/14
to faceb...@googlegroups.com
Hi .
How can i publish photos to friends timeline using the userid of particular user. I tried a lot but i am getting error like 

"error":{"message":"(#200) This app is not allowed to publish to other users' timelines.","type":"OAuthException","code":200}}

message - (#200) This app is not allowed to publish to other users' timelines.

I allowed all permissions in my app. For videos its publishing. For the status message and photos i am getting the error.
Please help me in solve this issue.

My code.

public class Users {
public static void main(String[] args){
try {
Facebook facebook = new FacebookFactory().getInstance();
String userid = null;
String query = "SELECT uid ,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user=1";

JSONArray jsonArray = facebook.executeFQL(query);
for (int i = 0; i < jsonArray.length(); i++) {
   JSONObject jsonObject;
try {
jsonObject = jsonArray.getJSONObject(i);
System.out.println(jsonObject);
userid = jsonObject.getString("uid");
System.out.println(userid);
} catch (JSONException e) {
e.printStackTrace();
}
}
Media m1=new Media(new File("image loc."));
        String postid= facebook.postPhoto("userid of friend", m1);
        System.out.println(postid);
facebook.postStatusMessage("userid of friend.","Hello...");

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

}

I am passing app id, app secret and accesstoken through facebook4j.props file.

Valeria Silva

unread,
Aug 21, 2014, 4:39:00 PM8/21/14
to faceb...@googlegroups.com
Hello Visakh ...
I read that the method to post to users is deprecated since february 6, 2013. That is, if you want to post on some user's timeline you must to invoke the feed_dialog...
You have more informations here https://developers.facebook.com/docs/apps/migrations/completed-changes.

Sorry for my English!
Reply all
Reply to author
Forward
0 new messages