我正在尝试简单的程序来更新 FB 状态,但它给了我错误,这就是我正在尝试的...
public class SendtoFacebook {
public static void main(String a[]) throws FacebookException {
SendtoFacebook sfb = new SendtoFacebook();
sfb.send("From My App: Rohan's App");
}
public void send(String message) throws FacebookException {
String FB_APP_API_KEY = new String("461632878708096");
String FB_APP_SECRET = new String("5513aa2b99879879897ff0fa5a7a");
String FB_SESSION_KEY = "";
FacebookJsonRestClient facebook = new FacebookJsonRestClient(FB_APP_API_KEY, FB_APP_SECRET);
//FacebookJsonRestClient facebookClient2 = (FacebookJsonRestClient)facebook.getFacebookRestClient();
FacebookJsonRestClient facebookClient = (FacebookJsonRestClient) facebook;
facebookClient.stream_publish(message, null, null, null, null);
System.out.println("successfully updated");
}
}
我得到这个错误_线程“主”com.google.code.facebookapi.FacebookException中的异常:com.google.google.code.facebookapi.JsonHelper.parseCallResult(JsonHelper.java:59)需要参数uid或会话密钥。 .code.facebookapi.ExtensibleClient.extractString(ExtensibleClient.java:2296) 在 com.google.code.facebookapi.ExtensibleClient.stream_publish(ExtensibleClient.java:2150) 在 com.google.code.facebookapi.SpecificReturnTypeAdapter.stream_publish(SpecificReturnTypeAdapter.java :503) 在 socialdemo.SendtoFacebook.send(SendtoFacebook.java:31) 在 socialdemo.SendtoFacebook.main(SendtoFacebook.java:19)
有小伙伴知道这个吗?plz ..谢谢。