我在 Eclipse 和 FB jar 库(FacebookBlackBerrySDK-v0.8.25.jar)中使用 BBplugin 5.0 版我收到错误 API 错误代码:11 API 错误描述:此方法已弃用错误消息:Display=wap 对话框已被已弃用。您可以通过禁用“july_2012”迁移来临时启用它们。它们将在 2012 年 7 月 1 日永久停止工作。
我检查了这个链接..但它没有给出解决方案
我只尝试了 2012 年 7 月的迁移解决方案我还没有尝试过解决方案 display=wap into display=touch
因为我不知道它在哪里
在模拟器上运行时出现以下错误
http://tinypic.com/view.php?pic=191m3o&s=6
import com.blackberry.facebook.ApplicationSettings;
import com.blackberry.facebook.Facebook;
import com.blackberry.facebook.FacebookException;
import com.blackberry.facebook.inf.User;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.container.MainScreen;
public class MyScreen extends MainScreen implements FieldChangeListener{
private User user;
String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
String APPLICATION_ID = "My App id"
String APPLICATION_SECRET = "My Application Secret";
String[] PERMISSIONS = Facebook.Permissions.ALL_PERMISSIONS;
private Facebook fb;
private ApplicationSettings as;
private String id="";
private EditField ef;
private ButtonField bf;
public MyScreen(String id ) {
// this.user = user;
this.id = id;
ef = new EditField("Hi", " ");
bf = new ButtonField("Publish");
bf.setChangeListener(this);
add(ef);
add(bf);
}
private void FBPost(){
ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);
as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
fb = Facebook.getInstance(as);
try {
user = fb.getCurrentUser();
String result = user.publishStatus(ef.getText());
if ((result != null) && !result.trim().equals("")) {
Dialog.inform("Publish Success.");
} else {
Dialog.inform("Publish Failed.");
}
} catch (FacebookException e) {
// TODO Auto-generated catch block
Dialog.inform("Exception in myscreen");
e.printStackTrace();
}
}
public void fieldChanged(Field field, int context) {
if(field==bf){
String text = ef.getText();
FBPost();
}
}
}
以上是我的代码请查看