java - How to use mention feature in Facebook using user account id in Facebook4jar api? -
i trying make simple code using java , uses in facebook4jar .i want mention group members using ids numbers . searched on web, , understood " make mention using member id,you should use form @[id:0]".i trying this.but not work on following code ",if condition working . program executes code inside if statement , , print group members ids , comments them words not mention form.
import facebook4j.facebook; import facebook4j.facebookexception; import facebook4j.facebookfactory; import facebook4j.groupmember; import facebook4j.post; import facebook4j.reading; import facebook4j.responselist; import facebook4j.auth.accesstoken; public class test { public static void main(string[] args) throws facebookexception,interruptedexception { facebook facebook = new facebookfactory().getinstance(); facebook.setoauthappid("****", "***"); facebook.setoauthpermissions("user_friends,user_groups,user_photos,user_videos,user_birthday,user_status,user_likes,user_activities,user_location"); facebook.setoauthaccesstoken(new accesstoken("*****", null)); responselist<groupmember> members = facebook.groups().getgroupmembers("****") ; responselist<post> feeds = facebook.getfeed("******", new reading().limit(25)); (int = 0; < feeds.size(); i++) { post post = feeds.get(i); string message = post.getmessage(); string id = post.getid(); if(message.equalsignorecase("*****")){ (int j =0; j < members .size(); j++){ groupmember account=members.get(j); string id="@["+account.getid()+":]"; system.out.println(account.getid()); facebook.commentpost(id,id); } } } } }
Comments
Post a Comment