简体   繁体   中英

How to use Facebook SDK to post article to specific friend's wall? [android]

I was a beginner of facebook SDK. I have reference the facebook SDK sample inside "HellowFacebookSampleActivity"file and know how to use Request.newStatusUpdateRequest (post to the user's own Wall) But I do not know how to use Request.newPostRequest to post article to specific friend's wall and do not know how to use the inside parameters .In particular,I dont know how to use the third GraphObject parameter. I have been found a lot of information, but because the API has been revised ,so the information could not be used. Is there some examples or website allows me to accomplish this goal? Thank you so much! Here is the code that I want to used to be changed.

private void postStatusUpdate() {

if (user != null && hasPublishPermission()) { final String message = getString(R.string.status_update, user.getFirstName(), (new Date().toString()));

Request request = Request.newStatusUpdateRequest(Session.getActiveSession(), message, new Request.Callback() { //Request request = Request.newPostRequest(Session.getActiveSession(), "1000001851621**",GraphObject??? , new Request.Callback() { @Override public void onCompleted(Response response) { showPublishResult(message, response.getGraphObject(), response.getError()); } }); request.executeAsync(); } else { pendingAction = PendingAction.POST_STATUS_UPDATE; } }

Facebook updated their SDK a few months ago to require you to use a native feed dialog instead of your own method. This makes it so the user has to look at the pre-made facebook window to post anything on another person's wall.

Blog Post

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM