2013年2月25日 星期一

android facebook post to wall


Request request = new Request(Session.getActiveSession(), "me/feed", postParams,                               HttpMethod.POST, new Request.Callback(){...});
RequestAsyncTask task = new RequestAsyncTask(request); 
task.execute();
這裡的postParams 是 Bundle postParams = new Bundle();
而po出的文會成為什麼樣子則要看我們利用postParam填入什麼屬性。
postParams.putString("name", "Facebook SDK for Android");





linkThe link attached to this post (點選name或圖片會跳過去link)

pictureThe URL of a picture attached to this post. The picture must be at least 50px by 50px (though minimum 200px by 200px is preferred) and have a maximum aspect ratio of 3:1
(圖片上的那塊藍綠圖)

sourceThe URL of a media file (either SWF or MP3) attached to this post. If both source and picture are specified, only source is used.

nameThe name of the link attachment.(圖片上的Facebook Dialog)

captionThe caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.(圖片上的Reference Documentation)

descriptionThe description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.
(圖片上的Using Dialogs to interact with users)

propertiesA JSON object of key/value pairs which will appear in the stream attachment beneath the description, with each property on its own line. Keys must be strings, and values can be either strings or JSON objects with the keys text and href.
(會接在圖片上description後面)
actionsA JSON array containing a single object describing the action link which will appear next to the "Comment" and "Like" link under posts. The contained object must have the keys name and link.
"{'name'='text', 'link'='URL'}"
(會在圖片上like, comment的右邊然後文字為text,連結為URL)



http://developers.facebook.com/docs/reference/dialogs/feed/
https://developers.facebook.com/docs/reference/dialogs/

Facebook LoginButton Permissions

在新增LoginButton時,可設定可被公開的權限,那一總共有哪些
final List<String> PERMISSIONS_PUBLISH = Arrays.asList("publish_actions", "publish_checkins");
LoginButton authButton=(LoginButton)findViewById(R.id.authButton);authButton.setPublishPermissions(PERMISSIONS_PUBLISH);

PermissionDescription
read_friendlists讓你可取得使用者的好友名單

read_insights讓你可取得使用者允許的可視資料, 應用程式, 網域(domains the user owns)

read_mailbox讓你可取得使用者的收件匣資訊

read_requests讓你可取得使用者的好友所發出的請求

read_stream
讓你可取得使用者塗鴉牆上的News feed, 甚至具備搜尋的能力

xmpp_loginProvides applications that integrate with Facebook Chat the ability to log in users.
ads_managementProvides the ability to manage ads and call the Facebook Ads API on behalf of a user.
create_eventEnables your application to create and modify events on the user's behalf
manage_friendlists讓你的程式可以建立與編輯使用者朋友群組

manage_notificationsEnables your app to read notifications and mark them as read. Intended usage: This permission should be used to let users read and act on their notifications; it should not be used to for the purposes of modeling user behavior or data mining. Apps that misuse this permission may be banned from requesting it.
user_online_presenceProvides access to the user's online/offline presence
friends_online_presenceProvides access to the user's friend's online/offline presence
publish_checkins讓你的程式可以打卡

publish_actionsEnables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. This requires extra permissions from a person using your app. However, please note that Facebook recommends a user-initiated sharing model. Please read the Platform Policies to ensure you understand how to properly use this permission. Note, you do not need to request the publish_stream permission in order to use the Feed Dialog, the Requests Dialog or the Send Dialog.
rsvp_eventEnables your application to RSVP to events on the user's behalf



https://developers.facebook.com/docs/reference/login/extended-permissions/