FB.login in modal doesn't open popup

833 views Asked by At

we are using social now on the app, but we're encountering problems in the facebook modal.

In nutshell, a user browses to a facebook group and with a custom button, we open an URL that contains our app.

Problem consist in the fact that:

  1. if the URL is opened (due to the platform specification or version) in a full-screen browser when user click "FACEBOOK LOGIN" a login modal is shown, but
  2. if the URL is opened (as in some iOS versions) in the FB modal, no one modal is shown and is IMPOSSIBLE debug that one due to the fact that belogs to the facebook app (in this case -- not debugable)

Does someone have the same problem ??

Thanks in advance

EDIT

I attach also the code function:

function fbLogin() {
    $$Loader.start();

    Service.getFBAppID().then(
        function(res) {
        if (res) {
            $$FBAuthz.init(res).then(function() {

            // Try to show to the user FB login mask
            FB.login(function(res) {
                if (res.authResponse) {
                var token = res.authResponse.accessToken;
                $log.debug("INTRO: FB credentials valid. Fetching informations");

                // User authenticated successfully on FB
                // Try now to authenticate user into GoWeb system
                $$User.login(null, null, {
                    accessToken: res.authResponse.accessToken
                }).then(
                    function(res) {
                    $log.debug("INTRO: User will be redirect to state requested");

                    // User FB account exist and he's now authenticated into system
                    // Redirecting user to requested page
                    $state.go("home");
                    }, function(err) {
                    $log.debug("ERROR INTRO: FB user credentials appear to be not associate with any user in the system");

                    // System didn't recognize FB credentials inside system
                    // Try to ask to the user if has a valid app account
                    $state.go("check_user_account", {
                        accessToken: res.authResponse.accessToken
                    });
                    }
                );
                } else {
                $log.debug('INTRO: User cancelled login or did not fully authorize.');
                $$Loader.stop();
                }
            }, function() {
                $log.debug("INTRO: User refused to continue with login process");
                $$Loader.stop();
            });
            }, function(err) {
            $log.debug("ERROR INTRO: An error ocurred during FB initialization");
            $$Loader.stop();
            });
        } else {
            // If widget is not requested by an external platform treat case normally
            $$Loader.stop();
        }
        });
    }

Function is binded by controller (below piece)

 vm.fbLogin = fbLogin;

And used in HTML like belo

<gbo-row gbo-if-widget
         gbo-if
         condition-value="true"
         condition-operator-value="'=='"
         condition-provider="TenantService"
         condition-provider-field="data.fbEnabled"
         condition-provider-async-function="isActive">
  <gbo-button gbo-effect
              gbo-effect-delay="500"
              on-click="vm.fbLogin()"
              label="fb_login_action"
              gbo-effect-name="fadeBottomTop"
              classes-inner-button="col s12 m12 l12 blue"
              classes="hidden white-text col s8 offset-s2 m4 offset-m4 l2 offset-l5">
  </gbo-button>
</gbo-row>
0

There are 0 answers