# 10.1 Google Login

Go to your Firebase console>Your Project>Authentication>Sign-in-method and enable **Google** and save it.

<div align="left" data-full-width="false"><figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2FnbnSp3eHNFAM0epVNhNn%2Fimage.png?alt=media&#x26;token=daaebe7d-8e6e-4ae5-85a3-bfe826fa9358" alt=""><figcaption></figcaption></figure></div>

## Android Setup

1. You have to configure some stuff for Google sign-in. Go to the Google Cloud Console.

> Google Cloud Console: <https://console.cloud.google.com/apis/credentials/consent?project=travel-hour-252505>

2. Make sure you are signed in with the same account with which you have created the Firebase project. Also, make sure that on the top-left corner, your project is selected for which you are filling this consent.

<figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2F3ZRJSHKdMKsKdBRteVsf%2Fimage.png?alt=media&#x26;token=71aeb1f7-11de-4f71-99ce-be23bd1ea584" alt=""><figcaption></figcaption></figure>

3. Now Click on the **OAuth consent screen tab > External > Create** and start filling out the form.
4. Enter the **Application name**, **Application logo** & **Support email**.

<figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2F2Ix3JPmAimXWPSF8j3Pe%2Fimage.png?alt=media&#x26;token=f36e9cf2-41af-4087-9527-c2831417a77e" alt=""><figcaption></figcaption></figure>

5. In all these places, you have to enter the same link starting with **https\://** then your app domain name which I have marked with green below.
6. Then, scroll down and fill in the Application Homepage link, Application Privacy Policy link, and Application Terms of Services link.

<figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2Fwk2GICodsYxmXJN1Ff67%2Fimage.png?alt=media&#x26;token=26232209-603f-4311-8213-d26fe186bcb5" alt=""><figcaption></figcaption></figure>

7. Save the form by clicking on the Save button.

### Generate Debug Certificate

* To generate a debug certificate, run this command on your terminal from your app

  root directory.

{% tabs %}
{% tab title="Mac" %}

```
keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
```

{% endtab %}

{% tab title="Windows" %}

```
keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If this command doesn’t work, then go to this [link](https://developers.google.com/android/guides/client-auth) and copy the debug command from there according to your os.
{% endhint %}

* Use ​**android** as a debug password when the terminal asks for a password.

<figure><img src="https://lh6.googleusercontent.com/f8BzDO8crzYiwc2v7AfkKyJq1yFmoF6IwFblbkm89LrcKJWkRVuxxgxiTCrVyjxNQaffwhoaaXoPpNy5GBPIw869tiOZzlZ_lxfJezWD9D924HhKCEC8ET3-ahE8xRYJiQZsjUt2L1NC76p17zapQyRy-AP55MvHG-H5PRN_0zpn7RGGxlhVBnyN5-Zu" alt=""><figcaption></figcaption></figure>

* Copy the **SHA1** certificate code and go to **Firebase Console > Your Project > Project Settings** and click on the android icon and then add the **SHA1** code by clicking ​**add fingerprint​** button. Look at the picture below:

<figure><img src="https://lh3.googleusercontent.com/NiFFfBOiIGw_FxsQ_DDn57E3-Q9LvspXdAdpmred0Z1eXBM_1SFFDjIW-CUHEi7YnmQKoBf2JGi3LysoNoqZH9jh0iNIPOap0WZQULQvURTiOqx9gOyk-n2Nnm_H_pY6JnEj4uZVbl6GsLWtGquqEbB83w12csRd3u8hVdMliaV47CoyVAdCBZWG9rTZ" alt=""><figcaption></figcaption></figure>

### Generate Release Certificate

To generate a release certificate,

* Run with replacing your **alias\_name** and **keystore\_location**.

```
keytool -list -v -keystore keystore_location -alias alias_name
```

{% hint style="info" %}
Your alias\_name is **upload** and keystore\_location is the path(directory) of the **upload-keystore.jks** file.
{% endhint %}

* After that, you will get a **SHA1** code. Copy that code and add it to your **Firebase Console > Project Settings >  Android**, where you previously added a debug SHA1 code.

<figure><img src="https://lh3.googleusercontent.com/NiFFfBOiIGw_FxsQ_DDn57E3-Q9LvspXdAdpmred0Z1eXBM_1SFFDjIW-CUHEi7YnmQKoBf2JGi3LysoNoqZH9jh0iNIPOap0WZQULQvURTiOqx9gOyk-n2Nnm_H_pY6JnEj4uZVbl6GsLWtGquqEbB83w12csRd3u8hVdMliaV47CoyVAdCBZWG9rTZ" alt=""><figcaption></figcaption></figure>

***

## iOS Setup

From the Source code, go to the **ios/runner/**&#x200B;**GoogleService-info.plist**​ file from your IDE or from  Xcode and copy the **REVERSED\_CLIENT\_ID**. (See the picture below)​

<figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2FsfeqYQyfYCos4ZC58lPb%2Fimage.png?alt=media&#x26;token=042d6019-486b-4f0a-bc5a-fd5a01df2305" alt=""><figcaption></figcaption></figure>

* Go to the **i​os/Runner/Info.plist​** file and replace the **R​EVERSED\_CLIENT\_ID** here.

<figure><img src="https://193695234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuVX9DkcSpz5pWRDwpVCd%2Fuploads%2FO5rt6GZZrR9vPuZiErMK%2Fimage.png?alt=media&#x26;token=12c1d06a-328f-491c-a263-4bab6607ff7c" alt=""><figcaption></figcaption></figure>
