Connect to facebook api in blackberry

。_饼干妹妹 提交于 2019-11-28 14:03:32

问题


i found an sdk here:

http://www.baskoro.web.id/facebook-connect-blackberry-HOWTO.html

i tried to run the code both on device and simulator but it shows only white screen and nothing else

i also tried this without result token:

.append("&next=http://www.facebook.com/connect/prompt_permissions.php?api_key=" + "api_key" + "&display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&fbconnect=true&ext_perm=read_stre...")

but no success

i also tried this without result token:

StringBuffer url = new StringBuffer() .append("http://m.facebook.com/login.php?") .append("api_key=") .append(facebookFacade.getApplicationKey()) .append("&connect_display=page") .append("&v=1.0") .append("&fbconnect=true") .append( "&next="http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&fbconnect=true" );

i dont have result token how to get that????

Plzzzzzzzz help


回答1:


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




回答2:


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)




回答3:


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



来源:https://stackoverflow.com/questions/3429600/connect-to-facebook-api-in-blackberry

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