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

Hello everybody,

I have a display problem with my facebookConnection. I have a connection 
class with inscription class. with my app, it's possible to use the 
facebook connection.
But when i click the facebook button in order to load the home page when 
the connection has success, i see nothin after the facebook login ( 
fb.doLogin () ) . 

b_fcb.addActionListener((e) -> {
            String clientId = "xxxxxxxxxxxxxxxxxx";
            String redirectURI = "https://www.facebook.com/";;
            String clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
            Login fb = FacebookConnect.getInstance();
            fb.setClientId(clientId);
            fb.setRedirectURI(redirectURI);
            fb.setClientSecret(clientSecret);
            Log.p("1");
//            System.out.println("token = "+fb.getAccessToken());
            fb.setCallback(new LoginCallback() {
                @Override
                 public void loginSuccessful() {
                     /*InfiniteProgress ip = new InfiniteProgress();
                    ip.setUIID("InfiniteProgress");
                    final Dialog d = ip.showInifiniteBlocking();*/

                    Preferences.set("token", 
fb.getAccessToken().getToken());
                    final FacebookData data = new FacebookData();
                    data.fetchData(Preferences.get("token", (String) null), 
() -> {
                        Display.getInstance().callSerially(new Runnable() {
                            public void run() {
                                Dialog.show("Bravo ", "Bienvenu " + 
data.getName(), "OK", null);
                                manager.cheminPhoto = data.getImage();
                                manager.fcbLog = data.getName();
                                manager.isFcb = true;
                                manager.setLogin(data.getName());
                                manager.lanceFcbInsc();
                            }
                        });

                    });

b_fcb.addActionListener((e) -> {
            String clientId = "xxxxxxxx...xxxxxx";
            String redirectURI = "https://www.facebook.com/";;
            String clientSecret = "xxxxxx...xxxxxxxxxx";
            Login fb = FacebookConnect.getInstance();
            fb.setClientId(clientId);
            fb.setRedirectURI(redirectURI);
            fb.setClientSecret(clientSecret);
            Log.p("1");
            fb.setCallback(new LoginCallback() {
                @Override
                 public void loginSuccessful() {
                     /*InfiniteProgress ip = new InfiniteProgress();
                    ip.setUIID("InfiniteProgress");
                    final Dialog d = ip.showInifiniteBlocking();*/

                    Preferences.set("token", 
fb.getAccessToken().getToken());
                    final FacebookData data = new FacebookData();
                    data.fetchData(Preferences.get("token", (String) null), 
() -> {
                        Display.getInstance().callSerially(new Runnable() {
                            public void run() {
                                Dialog.show("Bravo ", "Bienvenu " + 
data.getName(), "OK", null);
                                manager.cheminPhoto = data.getImage();
                                manager.fcbLog = data.getName();
                                manager.isFcb = true;
                                manager.setLogin(data.getName());
                                manager.lanceFcbInsc();
                            }
                        });

                    });
                 
                    // i launch the home page because of loginSuccessful
                    manager.lanceListeEvents("Ville");
                 }

                 @Override
                 public void loginFailed(String errorMessage) {
                     Form ff = new Form("Echec de connection", new 
BoxLayout(BoxLayout.Y_AXIS));
                     Label l = new Label("Erreur de connection facebook");
                     ff.addComponent(l);
                     ff.show();
                 }
             });
             
             //trigger the login if not already logged in
             if (!fb.isUserLoggedIn()) {
                 fb.doLogin();
             } else {
                 //get the token and now you can query the facebook API
                String token = fb.getAccessToken().getToken();
            }
        });

please help me.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/bf723f1f-b5cd-4785-a710-54e988933fba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to