How to use the GoogleLogin Mobile Builder component?

How to use the GoogleLogin Mobile Builder component?

Convertigo Mobile builder offers a way to authenticate users with their Google account in your Mobile application.

GoogleLogin component Setup

In your Mobile application, you may want to authenticate users by the built-in Android configured Google account (for Android devices) or directly the Google Sign-in form (iOS devices). Mobile Builder GoogleLogin component is the solution. It allows you to perform a Google authentication to retrieve some user's data. See the Convertigo component documentation here for more details on the different properties.

Configuring Google environment

For this component to work properly, you will need to setup some Google configuration using the Google API Console. First of all, connect to the Google API Console here: https://console.developers.google.com/apis

01_GConsoleAPI_LI


Google API console

Then, create a new project. You can give it the same name as your Mobile Builder project.

02_NewProject_LI


New project

Add new OAuth client ID credentials for both Android and iOS platforms.

03_Credentials


Adding OAuth 2.0 credential

04_Credentials_Android_iOS


OAuth 2.0 credentials list

Set the Bundle ID (iOS) and the package name (Android) to the name you set in your project (YourProject -> MobileApplication -> Application ID property or the name that has been automatically generated if property is left empty: com.convertigo.mobile.<projectName>)

Android debug keystore:

When building your APK in debug mode, you can find the requested Signing-certificate fingerprint value by typing the following command:





keytool -list -keystore ~/.android/debug.keystore



Copy the SHA1 value to the Google developers console.

07_Android_fingerprint_debug_keystore


Signing-certificate fingerprint command line



05_Credentials_Android_fingerprint_LI


Signing-certificate fingerprint Google console

You can verify the certificate fingerprint in your built APK by unzipping it and execute following command:





keytool -printcert -file CERT.RSA



You have to find back the same SHA1 value.

07_Android_fingerprint_apk


Signing-certificate fingerprint inside APK

Android release keystore

iOS URL scheme

Copy the iOS URL scheme and create a customAction component in your project and set the Application plugins property to:





Application plugins [[cordova-plugin-googleplus, 7.0.0, {REVERSED_CLIENT_ID: '<iOS URL schema>'}]]



05_Credentials_iOS_URL_Schema_LI


Client ID for iOS



06_CustomAction_Application_plugins


Convertigo Mobile Builder project (Studio)

Back to post list ...