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
  • Application in the background: Specific case from Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
CheckUserIDentity (Function)
In french: VérifieIdentitéUtilisateur
Allows you to check the real identity of the current user via biometrics check.
If the authentication is available, a message asks the user to authenticate himself. Then, the WLanguage authentication procedure is called.
Caution: This function only verifies the user's identity via the data stored on the mobile phone. It is not possible to capture the user's fingerprint.
Remarks:
  • iPhone/iPadIOS WidgetMac Catalyst This function is available from iOS version 8.0. The project must be compiled with Xcode 6 (or later). This function is using:
    • the "Touch ID" feature of iPhones 5S and later versions.
    • the "Facial recognition" feature of iPhone X.
  • Android This feature is available from Android 6.0 (api level 23).
Example
CheckUserIdentity("Vérification de l'identité pour déblocage", Authentification)

// Procédure de vérification
INTERNAL PROCÉDURE Authentification(nEtat is int, sMessageErreur is string)

SWITCH nEtat
CASE cuiAuthenticated
// Authentification OK.
CASE cuiAuthenticationFailure
Error("Échec de l'authentification: " + sMessageErreur)
// On réessaye.
CheckUserIdentity("Vérification de l'identité pour déblocage", Authentification)
CASE cuiCustomAuthentication,cuiAuthenticationUnavailable
// Saisie d'un mot de passe dans ce cas.
mdp is string
SWITCH Input("Entrez le mot de passe: ", mdp)
CASE 1: // OK
IF mdp ="1234" THEN
// Authentification OK.
ELSE
Error("Mot de passe incorrect")
// On réessaye.
CheckUserIdentity("Vérification de l'identité pour déblocage", Authentification)
END
CASE 0: // Annuler
Close()
END
END
END
Syntax
CheckUserIDentity(<Message> , <WLanguage procedure> [, <Button caption>])
<Message>: Character string
Message that will be displayed to the user.
iPhone/iPadIOS WidgetMac Catalyst
  • If this string is a multiline string, only the first line will be visible in the authentication popup.
  • This parameter is ignored during a facial recognition.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called once the user authentication is complete. This procedure has the following format:
PROCEDURE <Nom de la procédure> (<Etat>, <Message d'erreur>)
where:
  • is an Integer constant indicating the authentication status:
    cuiAuthenticatedThe user was properly authenticated.
    cuiAuthenticationFailureThe authentication failed.
    cuiAuthenticationUnavailableThe authentication feature is not available or it was disabled by the user.
    cuiCustomAuthenticationThe user wants to authenticate by using a password: the application will have to manage this authentication manually
  • is a character string containing the system error message if the authentication fails (cuiAuthenticationFailure constant). Otherwise, this parameter corresponds to an empty string.
<Button caption>: Optional character string
Default caption of authentication button (displayed on the button for typing the password). This button is used to connect without checking the biometrics. This button is displayed as soon as the first failure occurs.
Remarks
Android

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
CheckUserIDentity can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Component: wd290android.aar
Minimum version required
  • Version 20
Comments
Click [Add] to post a comment

Last update: 11/22/2023

Send a report | Local help