Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

81 lines (42 sloc) 5.72 KB

Google Firebase Console Setup Android & iOS

Android Setup

1. First of all, we will have to create an application on the Google Firebase Console. You can access it here.

Creating Application 1

Enable Google Authentication

After creating your project, go to the Authentication section in the left hamburger menu of the Firebase Console, and press Select Sign In Method.

Enable Google Authentication

In the Sign-in provides options, select and enable Google.

Enable Google Authentication 2

Configuration File

After creating your project and enabling Google Sign In on the Google Firebase Console, we will need a configuration file for our application, you can generate the file from your project settings section (press the settings knob).

Creating Application 2

2. Select the platform you wish to generate the configuration file for, in this case we will select Android.

Creating Application 2

3. After selecting Android, we will need to fill out the form with the information of our App, to enable Google Sign-In, and to do so we will need to provide Google with the package name, the name of the App and a SHA-1 certificate.

Creating Application 3

For our example application we will use a debug key, but to publish your app to the store, you will need a different SHA-1 key. You can read more about it here.

For the SHA-1 debug key you will need to modify the command bellow, open a CMD or Terminal and paste the bash:

Mac: keytool -list -v -keystore /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Windows: keytool -list -v -keystore "C:\Users\[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

4. Finally, you will be able to download the google-services.json file and add it to your Xamarin.Android project.

Creating Application 4

PDT: If you replace the google-servies.json file on the sample project and change the Xamarin.Android package name of the project to yours, the android sample project should work.

iOS Setup

We will also need to create a configuration file for iOS, which you can get in the settings section of you're project in Firebase Console, the steps are very similar to the one we just did for android, you will select the Application name we initially created and your application bundle id. This time there will be no need to add SHA-1 certificate, so go ahead and enable the Google Sign-In option.

You can find your application bundle id by opening the Info.plist file in your iOS Project. iOS Application bundle id

Fill out the form with the required information and register the App.

iOS Application integration

  1. Download the GoogleService-info.plist file and add it to your Xamarin.iOS project, Important: you must set the Build Action of this file as a BundleResource so the Plugin can find it as part of the app bundle at runtime.

Creating Application 5

  1. Next we will have to add the URL Scheme to our project. So Open the GoogleService-info.plist file and copy the RESERVED_CLIENT_ID value. Creating Application 6

  2. Then open the Xamarin.iOS info.plist file, go to the Advanced tab, create a new URL with the editor role and paste it in the URL Scheme Field. Creating Application 7

Note: To be able to run the iOS project on the simulator, you will have to enable Keychain sharing on the Entitlements.plist:

Creating Application 8

Key chain sharing on iOS, need entitlements and for that we need a valid provision profile, find out more about it here.

After you have completed the integration of the configurations file to your project you're ready for the final steps in the Android Setup and iOS Setup guides.

<= Back to Table of Contents

You can’t perform that action at this time.