Sdkbox Facebook isLoggedIn(), login, logout, onLogin not working

Hello,

Wondering if anyone can help me out here. I am trying to implement the facebook sdk with my cocos2dx app through sdkbox.

http://www.sdkbox.com/plugins/facebook
Tutorial: http://blog.cocos2d-x.org/2015/08/getting-started-with-the-sdkbox-facebook-plugin/.

Whenever I try and call sdkbox::PluginFacebook::login(), the onLogin callback doesn’t get called at all, and it opens a “you have already authorized app” message which shows the onPermission callback is getting called.

Also when I check isLoggedIn(), it always returns false. Even though I have a FB session running when the app starts. Any ideas?

I also cant use logout function nothing seems to happen and there is no callback for it.

I have followed the tutorial closely and everything should be working correctly. Where do you guys suggest I put the callback listener? I have it in my scene init file currently.

Also if this the sdkbox facebook is still being updated then is there a solution you guys suggest I can use until then? Thanks a lot.

For call backs you can take a look at our sample project

Can you try it out and let me know if it works for you?

Unfortunately facebook SDK dosen’t provide a callback for logout yet.

Hey I got it too work. I was putting

    PluginFacebook::login();
    PluginFacebook::requestReadPermissions({sdkbox::FB_PERM_READ_EMAIL});

And the onPermission callback was being used instead of the onLogin() callback.

But now I am getting a server error whenever I am trying to call PluginFacebook::login(); while debugging. It works when my device is not in debugging mode.

Thanks

Actually if you use requestReadPermissions you don’t need to call login

Hey thanks that works. Another thing now is onGetUserInfo() isn’t getting called.

This worked it seems.

     std::vector<std::string> permissions;
    permissions.push_back(sdkbox::FB_PERM_READ_EMAIL);
    PluginFacebook::login(permissions);

Sorry I have another problem now. It seems onGetUserInfo gets called when I first log in. Then when I logout, and log back in. onGetUserInfo doesn’t get called. What triggers that callback?