Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
I want google login in cordova app for android platform by using **cordova  googleplus plugin** so I have made an android app on console developers google on google account and integrate it with my cordova app but when i run my cordova app on emulator i am facing error with code:8 and when i run on android phone the error becomes error:12501.So how to resolve it to run google login on my cordova app?


What I have tried:

I am trying to use cordova googleplus plugin for android platform in my cordova app
Here is my index.js code:

C#
bindEvents: function () {
        document.getElementById('loginBtn').addEventListener('click', function () {
            window.plugins.googleplus.login(
        {
            'scopes': '', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
            'webClientId': '', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
            'offline': true, // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
        },
        function (obj) {
            alert(JSON.stringify(obj)); // do something useful instead of alerting
        },
        function (msg) {
            alert("error");
            alert(msg);
        }
    );
        })
        document.addEventListener('deviceready', deviceReady, false);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900