facebook log in issue

24 views
Skip to first unread message

romanca...@gmail.com

unread,
Jun 4, 2016, 9:52:14 AM6/4/16
to CodenameOne Discussions
HI! i'm experiencing an error when i try to log in facebook. until yesterday it whorks , but today doesnt. what is wrong??


        Login fb = FacebookConnect.getInstance();
        fb.setClientId("nnnnnnnnnnnnnnnn");
        fb.setRedirectURI("http://www.xxxxxxxxxxx.com.ar");
        fb.setClientSecret("n1n1n1n1n1n1n1n1n1n1n1n1n1");
        fb.setCallback(new LoginCallback() {

            public void loginSuccessful() {
               
            }

            public void loginFailed(String errorMessage) {
            }
        });

        if (Storage.getInstance().readObject("token") != null) {
            String auxToken = Storage.getInstance().readObject("token").toString();
            FaceBookAccess.setToken(auxToken);
            fb.setAccessToken(new AccessToken(auxToken, ""));
        }
        if (!fb.isUserLoggedIn()) {
            fb.doLogin();

        } else {

            // get the token and now you can query the Facebook API
            String token = fb.getAccessToken().getToken();
            // ...
            FaceBookAccess.setToken(token);

        }
        //-----
        User me = null;
        try {
            me = FaceBookAccess.getInstance().getUser("me");
        } catch (Exception exp) {
            Dialog.show("Error", "An error occurred while logging in: ", "OK", null);
        }

        if (statLogin.validarUsuario(null, null, null, me.getId()) == true) {
            statParams.setParam("LastLoginMethod", "facebook");

            statLogin.loggeado();
        } else {

            try {
                   formRegistro.show();
            } catch (Exception ex) {

            }
        }

//----
    }


thanks





If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

Shai Almog

unread,
Jun 5, 2016, 1:13:26 AM6/5/16
to CodenameOne Discussions, romanca...@gmail.com
Hi,
on simulator/device? Both?
What's the error?
Reply all
Reply to author
Forward
0 new messages