Connect to facebook api in blackberry

这一生的挚爱 提交于 2019-11-29 18:16:26

Please use the latest SDK at here instead. You should be able to follow the short tutorial on the same page as well.

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)

i think before you start with sample codes. you need to study some of the links.

  1. OAuth 2.0

  2. facebook developer documents

after that you can get

client_id and client_secret from this link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!