ngFB.login() don't open the login popup


#1

Hi, I’ve created an app that uses openFB library to authenticate with Facebook.
It worked fine during development, in browser, in real Android and iOS devices and in Ionic View app.
But now that the app is finished I saw that when I press the login button in a real Android device, nothing happens and no error is shown.
I think is InAppBrowser blocking the login pop up.

Here is my call to the function:

<a class="item item-avatar" ng-click="menu.login()">
    <h2>Login with Facebook</h2>
</a>

And here my controller:

.controller('AppCtrl', function($scope, ngFB, $rootScope) {
    var vm = this;
    vm.login = function() {
        if(!angular.isDefined(vm.user)) {
            ngFB.login({scope: 'publish_actions'}).then(
                function (response) {
                    vm.getInfo();
                },
                function (error) {
                    alert('Someting went wrong: ' + error);
                });
        }else{
            vm.logout();
        }
    };

    vm.getInfo = function() {
        ngFB.api({path: '/me'}).then(
            function(user) {
                vm.user = user;
            });
    };
    vm.logout = function() {
        ngFB.logout().then(
            function() {
                vm.user = null;
                $rootScope.$broadcast('logged-out');
            });
    };
});

Works fine in browser, iOS and Ionic View but not in Android. Any idea?
Thanks!


#2

Running cordova plugins I saw that I uninstalled (don’t know when nor why) InAppBrowser plugin. Just reinstalled and everything it’s ok now.