I shared the URL of my Android application with FB:
Then I save aside (hardcoded) postId
I am trying to make "fb like" to this post
using this code but get an error message:
Button socialBtn3 = (Button) dialog
.findViewById(R.id.socialBtn3);
socialBtn3.setOnClickListener(new OnClickListener() {
String fbPostId = "685560152_10153809399380153";
@Override
public void onClick(View v) {
new LikeFbPostAsyncTask().execute(fbPostId);
}
});
and this:
public class LikeFbPostAsyncTask extends AsyncTask<String, Void, Void> {
public LikeFbPostAsyncTask() {
}
@Override
protected void onPreExecute() {
Log.i("LikeFbPostAsyncTask", "Starting web task...");
}
@Override
protected Void doInBackground(String... fbPostId) {
Request likeRequest = new Request(Session.getActiveSession(),
fbPostId + "/likes", null, HttpMethod.POST,
new Request.Callback() {
@Override
public void onCompleted(Response response) {
Log.i(TAG, response.toString());
}
});
Request.executeBatchAndWait(likeRequest);
return null;
}
@Override
protected void onPostExecute(Void res) {
}
}
{Answer: responseCode: 404, graphObject: null, error: {HttpStatus: 404, errorCode: 803, errorType: OAuthException, errorMessage: (# 803) Some of the aliases you requested do not exist: [Ljava.lang.String; @ 4284cd10}, isFromCache: false}
how can i solve this?
source
share