I’m developing a android application which is requires posting in groups created by the user.
Bundle params = new Bundle();
params.putString("link","www.google.com");
params.putString("message","Group Message");
try {
String res = fb.request(GROUP_ID+"/feed",params);
Log.w("Response",""+res);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Also i’m using the following permissions,
public static final String[] permissions = {"user_photos","friends_groups","read_stream","user_groups","publish_stream"};
But when i execute this, no exception is raised and the post is not made in the group’s wall.
When i tried to create @Mentions using, @[user_id:name] i’m not even getting the hyperlinks.
Can anyone help me in solving the above said two issues.
Thanks.
By default, the
fb.requestmethod uses a GET request. As you are intending to create a new post, you need to use the POST method. Doing this is simple – just pass a third argument (httpMethod) as “POST”.For example:
String res = fb.request(GROUP_ID+"/feed",params,"POST");For more info: https://developers.facebook.com/docs/reference/androidsdk/ayncrequest/
Also, the first argument needs to be a full URL, not just an ID –
https://graph.facebook.com/GROUP_ID/feedOf course, I’m making an assumption based on your variable name.