![](/img/trans.png)
[英]facebook Post on your behalf is not working in android facebook sdk 3.0.2
[英]Facebook Android Sdk 3.0.2 Post to me/feed doesn't look right
我正在使用新的Android版Facebook Sdk 3.0,並嘗試使用新的Graph Api請求在用戶牆上發布帖子。 現在,我可以發表帖子了,但是在Facebook頁面上,它顯示出好像我共享了一個鏈接(但我不希望這樣)。 我的最終目標是發布看起來像這樣的帖子: https : //docs.google.com/drawings/d/1ARTDj6qtSx4-qZQ0ZU1sZZppEMYMti8zwFLTZneSm2o/edit
當您單擊它時,您將轉到Facebook應用程序。 我的請求代碼:
Bundle params = new Bundle();
params.putString("name", title);
params.putString("caption", caption);
params.putString("description", description);
params.putString("picture", imageURL);
params.putString("link", FACEBOOK_APP_URL);
Request request = new Request(Session.getActiveSession(), "me/feed",
params, HttpMethod.POST, new Callback() {
@Override
public void onCompleted(Response response) {
// TODO Auto-generated method stub
}
});
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
此時,上面的代碼正在發布正確的圖像和文本,但是在單擊時,您將轉到圖像url,並且在帖子本身上的標題是“ Alexander共享鏈接”,依此類推。
提前致謝
試試這個代碼:-
Session s = Session.getActiveSession();
Request request = Request.newStatusUpdateRequest(s, "Testing App For genral purpose", new Request.Callback()
{
@Override
public void onCompleted(Response response)
{
if (response.getError() == null)
Toast.makeText(mContext, "Status updated successfully", Toast.LENGTH_LONG)
.show();
}
});
request.executeAsync();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.