Google Client Plugin For Xamarin – Pujolsluis Blog
Description: Just released the Google Client Plugin, it makes the process of authenticating a user across Xamarin Forms, Xamarin.Android and Xamarin.iOS with Google Sign In easier.
Date: 2018-07-01T06:03:39+00:00

# Google Client Plugin For Xamarin

in Plugins Xamarin on July 1, 2018 July 16, 2018 with 14 Comments Share Facebook Twitter Pinterest Email
0 Like this
Google Plugin Xamarin Forms

Just released the Google Client Plugin, it makes the process of authenticating a user across Xamarin Forms, Xamarin.Android and Xamarin.iOS with Google Sign In easier.

##

## Set Up

The setup process for the plugin is pretty simple and it’s well documented on the Google Client Plugin GitHub page. you can complete the Setup process following these steps:

- Install the nugget package into your PCL project and Client projects.

- Create your Google Firebase Console Platform application.
- Follow the Android and iOS guides

## Use It

You just have to use GoogleClient.Current

### Login

Here is an example of how to launch the login to the Google Client:

        CrossGoogleClient.Current.LoginAsync();

This method returns a Google User which contains the basic profile of the user that was authenticated, with the following structure:

### Logout

Here is an example of how to log out of the Google Client:

        CrossGoogleClient.Current.Logout();

### Available Properties

- ActiveToken (Signed In user token)

### Events

All async methods also trigger events:

Login event:

Official Google Sign In SDK Documentation:

https://developers.google.com/identity/

Full documentation of the project:

https://github.com/CrossGeeks/GoogleClientPlugin

Xamarin Forms sample project:

https://github.com/CrossGeeks/GoogleClientPlugin/tree/master/GoogleClient/GoogleClientSample

Made with ❤ by Pujols

(Visited 2,655 times, 1 visits today)
Auth Google Sign In Plugin Xamarin

### Share This

### Written By

#### Pujolsluis

I'm Luis Pujols a Software Engineer and Certified Xamarin Mobile Developer originally from the Dominican Republic. I currently work at CrossGeeks as part of an awesome team, developing in Xamarin Forms, In my free time, I'm a co-organizer of the DotNetDo software community, I also enjoy experimenting with new tech's, mentoring peers and attending or organizing software community events.

### You May Also Like

on March 5, 2019

## Streaming on Xamarin Forms – Xamarin Online LATAM FEST

on November 5, 2019

## Mobile DevOps Made Easy – TampaCC

on July 29, 2019

## Printing PDF’S and Images Xamarin.Forms

### 14 Comments

1. vipin krishna January 1, 2019 at 2:29 am

   Google sign works fine in android. But on ios, getting 7 native linking errors:
   Native linking error: clang: error: no such file or directory: ‘/Users/cybasetechnologies/Library/Caches/Xamarin/mtbs/builds/login2.iOS/0f92dcc98e9717a0d2643ed70077af70/obj/iPhone/Debug/mtouch-cache/FirebaseNanoPB’
   Native linking error: clang: error: no such file or directory: ‘/Users/cybasetechnologies/Library/Caches/Xamarin/mtbs/builds/login2.iOS/0f92dcc98e9717a0d2643ed70077af70/obj/iPhone/Debug/mtouch-cache/GoogleSignIn’
   and 5 more related with firebase

   Reply ↓
   1. Pujolsluis January 2, 2019 at 4:00 pm

      Hey Vipin,

      This is a known issue in iOS you can learn about the solution in this thread https://github.com/CrossGeeks/GoogleClientPlugin/issues/21, or find other alternative solutions on forums.

      Reply ↓
      1. vipin January 4, 2019 at 3:46 am

         installed missing ‘xamarin ios googlesign’ and ‘xamarin android firebase’ nuget packages removed errors…working now..

         Reply ↓
         1. Pujolsluis January 4, 2019 at 12:04 pm

            Alright! Great job, I’m glad you got it working☺️🙌

            Reply ↓
2. Pedro Martins January 10, 2019 at 8:59 am

   HI, thanks for the amazing plugin, but i keep getting the same error on iOS while on android i fully functional.
   The error i get is when i launch the app on iOS when calling the GoogleClientManager.Initialize(); it trows an error saying “Value cannot be null. Parameter name: path”

   Reply ↓
   1. Pujolsluis January 17, 2019 at 11:27 pm

      Hi Pedro!

      I’m glad you found the plugin helpful, it’s my pleasure. this issue is probably because you are missing the GoogleServices-Info.plist file on your iOS project or the Build Action of the file is not BundledResource please verify.

      Thanks!

      Reply ↓
3. deathly January 16, 2019 at 3:44 pm

   Android:

   _googleClientManager = CrossGoogleClient.Current;

   Unhandled Exception:

   Java.Lang.ClassNotFoundException: com.google.android.gms.auth.api.Auth

   Any ideas?

   ps. does post comment even work? akismet suspected me as spam wtf

   Reply ↓
   1. Pujolsluis January 17, 2019 at 11:22 pm

      Hey Deathly!

      I’m glad you are looking forward to use the plugin, and yes haha Akismet can do that sometimes sorry, please verify that all the dependencies for the plugin were installed correctly when you installed the NuGet, you can check the dependencies on Nugget Gallery. https://www.nuget.org/packages/Plugin.GoogleClient

      Reply ↓
      1. deathly January 18, 2019 at 11:48 am

         Thanks for reply. I have already managed to fix it. I was just blind.

         FIX for others blind persons like me 😀 :
         Install dependencies:
         Xamarin.GooglePlayServices.Auth (>= 60.1142.1)
         Xamarin.Google.iOS.SignIn (>= 4.1.1)

         Reply ↓
         1. Pujolsluis January 19, 2019 at 12:52 am

            I’m glad you got it working! Great job🥳🎊

            Reply ↓
4. Joe F April 11, 2019 at 9:24 pm

   Hi, great plugin for authentication, but how can I get the authentication token and refresh token to use with google apis? I understand that the CrossGoogleClient.Current.ActiveToken is supposed to have the authentication token, but for some reason mine does not. After authentication I check and it still seems to be null.

   Reply ↓
   1. Pujolsluis April 19, 2019 at 3:12 pm

      Hey Joe! to get the authentication token you must initialize the plugin with your google developer client ID, we have a section in the GitHub Getting Started guide were you can see how to enable these tokens.

      Reply ↓
5. Surendra November 6, 2019 at 4:32 am

   Hi, thanks for amazing plugin but after update to latest version I’m getting error in iOS Failed to resolve “Google.SignIn.ISignInUIDelegate” reference from “Google.SignIn, version=1.0.0.0, Cultuer=neutral, PublicKeyToken=null” MT2002.

   Any Idea what I’m missing here?

   Reply ↓
   1. Pujolsluis November 7, 2019 at 1:49 am

      Hello Surendra, I believe someone has already reported this issue on the github page of the plugin. There seem to be some issues with the latest version of iOS we are waiting on apple to see if it resolves with further updates if not we will take some time to check it out further. Thanks for the kind words we are glad you are able to make use of the plugin 🙂

      Reply ↓

### Leave A Comment Cancel reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

Δ

This site uses Akismet to reduce spam. Learn how your comment data is processed.

### Luis Pujols

I'm Luis Pujols a Software Engineer and Certified Xamarin Mobile Developer originally from the Dominican Republic. I currently work at CrossGeeks as part of an awesome team, developing in Xamarin Forms, In my free time, I'm a co-organizer of the DotNetDo software community, I also enjoy experimenting with new tech's, mentoring peers and attending or organizing software community events.
Search for:
https://www.youtube.com/watch?v=lRTsXA0mV9U

### Recent Posts

- [Workshop] Reactive Programming with .NET and Xamarin.Forms with Andres Pineda – .NET Dominicana
- [Study Group] Exam Prep Sessions For AZ-900 – .NET Dominicana
- [Panel] How to Become a Xamarin Developer – LATAM
- [Workshop] Azure For Devs – Week 5
- [Workshop] Azure For Devs – Week 4

### Recent Comments

- Pujolsluis on Google Client Plugin For Xamarin
- Surendra on Google Client Plugin For Xamarin
- Pujolsluis on Google Client Plugin For Xamarin
- Joe F on Google Client Plugin For Xamarin
- Pujolsluis on Google Plugin 1.1.0 Released: Goodies and Improvements

##

##

Loading Comments...
Write a Comment...
Email (Required)
Name (Required)
Website

###