TypeError: Unable to read googleplus property from undefined in IONIC using AngularJs

I followed these links to use social input in my hybrid app.

https://github.com/EddyVerbruggen/cordova-plugin-googleplus

https://ionicthemes.com/tutorials/about/google-plus-login-with-ionic-framework

I created all google developer id and all that. I installed the cordova-googleplus plugin using these two as they said. But still, my application shows an error, which I called the title of this post ...

In this line: window.plugins.googleplus.login (

So please help me with this ... I am stuck on this for 2 days ... Any help would be appreciated.

+4
source share
1 answer

The following is an example of checking cordova plugins in $ionicPlatform.ready()a function shell:

mainApp.run(["$ionicPlatform", "$window", function ($ionicPlatform, $window) {

    $ionicPlatform.ready(function () {
        if ($window.plugins && $window.plugins.googleplus) {
            $window.plugins.googleplus.isAvailable(
                function (available) {
                if (available) {
                    // show the Google+ sign-in button
                }
            });
        }
    ...

    }

PS: $windowis the Angular shell forwindow

+2
source

Source: https://habr.com/ru/post/1629669/


All Articles