想在朋友墙上发布有关使用黑莓 Facebook Sdk 的信息
我想将我的应用程序集成到 Facebook。我下载了 Facebook BB Sdk 现在我可以使用
user.publishStatus("Hello world")
I 在用户的墙上发布这个 sdk 的 read me 说 发布到用户朋友的留言墙上:
User[] friends = user.getFriends();
if (friends != null && friends.length > 0) {
for (int i=0; i<friends.length; i++) {
friends[i].publishPost(post);
}
}
但是 user.getFriends() 返回类型 Profile
并且没有像 publishPost()
这样的方法
我的问题是
如何使用 sdk 发布朋友墙?请帮助我..
谢谢
I want to integrate my application to Facebook. I download the Facebook BB Sdk and Now I can post on user's wall using
user.publishStatus("Hello world")
I the read me of this sdk says
To post to the user’s friends’ walls:
User[] friends = user.getFriends();
if (friends != null && friends.length > 0) {
for (int i=0; i<friends.length; i++) {
friends[i].publishPost(post);
}
}
But user.getFriends() returns a type Profile
and there is no method like publishPost()
My question is
How can i post friend's wall from using sdk ? please help me..
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 http://sourceforge.net/projects/facebook-bb-sdk/。之后你必须添加两个想法。
一种是当您想将照片发布到朋友墙上时,您必须在 JSONObject(Request) 中再添加一个键值 - 即 facebookuser.java publisePhoto 方法中的 requestObject.put("target_id",getid()) & facebook.java
其次是你必须更改 JSONObject responseObject = fb.write(getId() + "/photos", requestObject, pPhoto.getMIMEType(), imageData, true);
到
JSONObject responseObject = fb.write(getId() + "/photos?access_token="+Facebook.token, requestObject, pPhoto.getMIMEType(), imageData, true);in FacebookUser.java & Facebook.java
其中 token 是来自 Facebook.java 的静态字符串并存储 access_token 的值(您必须添加它)
Download graph api from http://sourceforge.net/projects/facebook-bb-sdk/. After that you have to add two thinks.
one is when you want to post a photo to your friends wall ,you have to put one more key-value in the JSONObject(Request) - that is requestObject.put("target_id",getid()) in publisePhoto method facebookuser.java & facebook.java
Second is you have to change JSONObject responseObject = fb.write(getId() + "/photos", requestObject, pPhoto.getMIMEType(), imageData, true);
to
JSONObject responseObject = fb.write(getId() + "/photos?access_token="+Facebook.token, requestObject, pPhoto.getMIMEType(), imageData, true);in FacebookUser.java & Facebook.java
where token is Static string from Facebook.java and store the value of access_token (you have to add it)