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是会出现在'留言 · 赞'後面的超连结(只有发布到自己的涂鸭墙才会出现) ListactionLiks = 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);