简体   繁体   中英

Google Provider Login with Firebase and Ionic

I have been trying to create an Ionic Google login popup with Firebase. However, when the user tries to press the login button, the function is called producing a popup that is surprisingly completely blank.

$scope.login = function()
{

        baseRef.authWithOAuthPopup("google", function(error, authData) 
        {

            if (error)
            {
                alert('Hello');
            }

            else 
            {
                $scope.auth = authData.google;
                $scope.user.set("name", $scope.auth.displayName);
                $scope.user.set("image", $scope.auth.profileImageURL)
                $scope.user.save();
            }

        });

};

All my permissions in Firebase and Google have been properly set as well as those in the config file. Does anyone have any idea how I can possibly fix this issue to allow a functional popup to spawn?

I had quite a problem with this also. It appears to work well with iOS, but no luck with android.

By using the command 'ionic state save' followed by 'ionic state restore' ionic readded the android and iOS platforms. It also added cordova-plugin-inappbrowser, cordova-plugin-whitelist (plugins) to the package.json file.

Next, I created an android build using 'ionic package build android' and send it to my OnePlus 2 using TestFairy.

Finally works, for both google and facebook.

In summary once the package.json file included the relevant plugins, I was able to create an APK file that worked with the firebase $authWithOAuthPopup.

(with these amendments, iOS still seems to work fine)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM