Cordova Google Authentication Tutorial

Cordova plugin google plugin enable google authentication for your Cordova (aka PhoneGap) applications. we can gather user name, email, dob..etc from Google.we can also do silent login with G+.

Advantages:

  • High Conversion Rate
  • No passwords & Signup

Add Plugin

<code <span class="hljs-keyword">class</span>=<span class="hljs-string">"language-bash"</span>>cordova plugin <span class="hljs-keyword">add</span> http:<span class="hljs-comment">//github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=reversedclientid</code></span>

Note: reversed client id without “double quotes”

Cordova plugin google plus example source code

<span class="hljs-built_in">window</span>.plugins.googleplus.login({
    <span class="hljs-comment">//options if any</span>
}, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">result</span>) </span>{
    alert(<span class="hljs-built_in">JSON</span>.stringify(result));
}, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">error</span>) </span>{
    alert(<span class="hljs-built_in">JSON</span>.stringify(error));
});

Read More:

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