AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones de teléfono
  • Prerequisites for using GglAccountAssociate
  • Operating mode
  • Miscellaneous
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Enables users to log in to an application using a Google account registered on the device, without entering a username and password.
Ejemplo
GglAccountAssociate(auth)

INTERNAL PROCEDURE auth(RESULT is int, Account is gglAccount)
	SWITCH RESULT
		CASE gaaCanceled
			STC_Auth = "Authentication canceled by the user."
		CASE gaaFailed
			STC_Auth = "Authentication error" + CR + ErrorInfo()
		CASE gaaSuccess
			STC_Auth = "Hello " + Account..FirstName + " " + Account..LastName
	END
 END
Sintaxis
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:
  • <Result>: Result of the authentication 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.
  • <Account>: GglAccount variable that contains the details of the profile associated with the selected Google account.
Observaciones

Prerequisites for using GglAccountAssociate

  1. Create 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: On the "OAuth consent screen" tab, fill in the different fields, and in particular the links to 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 used:
  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.
    Remark: This authorization can be granted in 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.
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd300android.aar
Versión mínima requerida
  • Versión 2024
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 20/09/2024

Señalar un error o enviar una sugerencia | Ayuda local