ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Phone functions
  • Prerequisites for using the GglAccountAssociate function
  • Operating mode
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
GglAccountAssociate (Function)
In french: GglCompteAssocie
Enables users to log in to an application using a Google account registered on the device, without entering a username and password.
Example
GglAccountAssociate(auth)

INTERNAL PROCEDURE auth(resultat is int, Compte is gglCompte)
	SWITCH resultat
		CASE gaaCanceled
			LIB_Auth = "Vous avez annulé l'authentification."
		CASE gaaFailed
			LIB_Auth = "Erreur pendant l'authentification" + CR + ErrorInfo()
		CASE gaaSuccess
			LIB_Auth = "Bonjour " + Compte..Name + " " + Compte..FirstName
	END
 END
Syntax
GglAccountAssociate(<WLanguage procedure>)
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when the authentication result is obtained. This procedure has the following format:
GglAccountAssociate_Callback(<Result>, <Account>)
where:
  • <Résultat> Result of the identification process:
    gaaCanceledAuthentication was canceled by the user.
    gaaSuccessAuthentication successful. The application has been associated with the user's Google account.
    gcaFailedUnable to log in. To get more details on the error, use ErrorInfo.
  • <Compte> Variable GglAccount describing the profile information associated with the selected Google Account.
Remarks

Prerequisites for using the GglAccountAssociate function

  1. Create a project in the Google Cloud console (https://console.cloud.google.com) or open an existing project.
  2. Click "APIs & Services".
  3. On the "Credentials" tab, click "CREATE CREDENTIALS", then "OAuth Client ID", expand "Application type" and select "Android" (if you don't have an ID of this type yet). Specify your application's package name and SHA-1 signing certificate fingerprint.
    WINDEV Mobile provides this package name in the first step of the Android application generation wizard.
    The SHA-1 signature can be found in the Android application generation wizard ("Configuration", "Advanced configuration").
  4. On the "Credentials" tab, click "CREATE CREDENTIALS", then "OAuth Client ID", expand "Application type" and select "Web application" (if you don't have an ID of this type yet). You can leave the "Authorized JavaScript origins" and "Authorized redirect URIs" empty. This ID represents your "back end" authentication server. This ID must be specified in the Android application generation wizard in WINDEV Mobile.
  5. Optional step: In the "OAuth consent screen", complete the information and in particular the URLs for the privacy policy and terms of use.
In the application generation wizard, in "'Sign in with Google' authentication", enter the web application client ID defined previously.

Operating mode

GglAccountAssociate uses Sign in with Google (formerly Google Sign-In).
When GglAccountAssociate is called:
  1. An external window allows the user to select the Google account to be used. This sign-in window lists the Google accounts registered on the device that authorize third-party applications to use profile information.
    Note: This authorization can be given on the Google Account configuration page.
  2. User simply select the account and confirm.
After a completing a login process with the GglAccountAssociate function, you can retrieve user details such as first name, last name and email address. This can be useful for personalizing the user experience, for example.

Miscellaneous

  • GglAccountAssociate must be executed from the main thread, and at least one window from the application must be open when the function is called. A fatal error will be raised if this is not the case.
  • GglAccountDissociate dissociates the application from the user's Google account on the device.
Business / UI classification: Neutral code
Component: wd300android.aar
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help