Polymer 1.0: I need a working example of <google-signin-aware>

1.3k Views Asked by At

Question:

Can someone please provide a working code example of how to use <google-signin-aware>?


I have a custom <paper-button> I'm trying to make a login button for Google.

Here is the user documentation.

Here is the Github repository.

1

There are 1 best solutions below

1
On BEST ANSWER

Probably the best example for using google-signin-aware is the google-signin element itself.

Essentially what you have to do is to include google-signin-aware with the required attributes and then call the signIn method on this element.

<google-signin-aware
    id="aware"
    client-id="..."
    scopes="..."
    ...
    is-authorized="{{isAuthorized}}"
></google-signin-aware>

<paper-button on-tap="_signIn">Sign In</paper-button>


 _signIn: function () {
   this.$.aware.signIn();
 }