Just released the new stable version of Google Client Plugin (v1.1.0), packed with a bunch of goodies and improvements added by and for the community.
I’m really thankful for all the new collaborators of the Community that have used, enjoyed and contributed to the project making possible the new release (RomaRudyak, Thiago Carvalho, Nathalia).
What’s New?
- Silent Login
- User Active Token
- Enable Additional Scopes and API’s
- New Properties Exposed on the Google User.
- Enabling Server Auth Code or RequestIdToken Programmatically
- Exceptions (NotInitialized, SignInCancelled, KeychainError, etc)
Silent Login
After testing and reviewing different test cases, our community has identified the need to silently login their users if they have already logged in the app from their device without the need to interact with the UI from the Google Sign In SDK and simply set the UI on the Authenticated state.
You can now do this simply calling this line of code:
User Active Token
You can now access the User Active Token once your users have authenticated correctly through the plugin either on iOS and Android.
You can do this by simply using the new ActiveToken Property on the plugin:
Enable Additional Scopes and API’s
In case you wish to enable additional Scopes and API’s to access different types of information, you can now do so simply by passing in 2 new parameters containing arrays with the scopes and API’s you want to enable on the Google Plugin Initialize method.
New signature of the initialize methods:
- Android.
- iOS.
New Properties Exposed on the Google User
Our users requested the exposure of the Given Name and Family Name properties for more flexibility handling the name of the user in their app’s, you can now access these properties on the Google User Model returned from the LoginAsync Method.
Enabling Server Auth Code or RequestIdToken Programmatically (Optional)
If you have a more complex development flow, that integrates CI in which it’s better to just set your Server Client ID and RequestIdToken programmatically for the Plugin you can do so, sending the Web Client Id on each projects Initialize method respectively.
- Relevant Google Documentation about this topic:
Authenticate with a backend server
Get your backend server’s OAuth 2.0 client ID
- Android.
-
-
- Enable Client Id Programmatically
-
After applying this changes, you should now be able to see that your ActiveToken no longer returns null when you access it on the plugin after a successful login.
-
- iOS.
-
- Enable Client Id Programmatically
-
Exceptions (NotInitialized, SignInCancelled, KeychainError, etc)
Another good addition that was done while polishing and improving the code base for the Plugin, Is adding a bunch of useful Exceptions that will make the use of it during development way more intuitive if you need to debug an issue or any mistake on your initial configuration, Exceptions like the following:
The complete list of Exceptions available on Google Client Plugin.
Made with ❤ by Pujols
Thank you for your post!
How about Google Drive?
I’m glad that it was of use to you!🙌
How about Google Drive?
Well sounds like an interesting and good idea for a new plugin for the community, will be looking into it in the next weeks and keep I’ll keep you updated.
Thanks for the support :).
help need..https://stackoverflow.com/questions/54573154/java-lang-illegal-state-exception-for-googleclientmanager-logout-in-xamarin-form
Hi Vipin! I have answered your issue on StackOverflow as requested, I’m glad your looking forward to using the plugin☺️