1. 發佈通知給使用者的朋友
List reciver = new ArrayList(); reciver.add(friendsUID); client.notifications_send(reciver, "msg");
2. 貼訊息到使用者的塗鴨牆上
// 貼訊息到使用者的塗鴨牆上(每個使用者一日限十篇)
// 設定張貼的訊息
Attachment attachment = new Attachment();
attachment.setName("Name");
//設定Name的超連結位址
attachment.setHref("http://www.google.com.tw/");
attachment.setCaption("caption");
attachment.setDescription("yahoo description\ntest");
//加入圖片
AttachmentMediaImage attachmentMediaImage = new AttachmentMediaImage("http://www.google.com.tw/intl/en_com/images/logo_plain.png", "http://www.google.com");
attachment.setMedia(attachmentMediaImage);
//ActionLink是會出現在'留言 · 讚'後面的超連結(只有發佈到自己的塗鴨牆才會出現)
List actionLiks = new ArrayList();
BundleActionLink bundleActionLink = new BundleActionLink("yahoo", "http://tw.yahoo.com");
actionLiks.add(bundleActionLink);
//發佈到塗鴨牆
client.stream_publish("This is a Java API Test.", attachment, actionLiks, null, null);





沒有留言:
張貼留言