Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FacebookScreen extends MainScreen {
- private String APPLICATION_ID = "xxxxxxxxxx";
- private String APPLICATION_SECRET = "xxxxxxxxxx";
- private String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
- private String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
- public FacebookScreen(){
- ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
- Facebook fb = Facebook.getInstance(as);
- try {
- fb.getCurrentUser(new BasicAsyncCallback(){
- public void onComplete(com.blackberry.facebook.inf.Object[] objects, final java.lang.Object state) {
- User user = (User) objects[0];
- user.publishStatus("Facebook BB SDK testing");
- }
- public void onException(final Exception e, final java.lang.Object state) {
- System.out.println("FB Error: "+e.getMessage());
- }
- });
- }
- catch (FacebookException fbe){
- System.out.println(fbe.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement