AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de geolocalización
  • Observaciones
  • Permisos necesarios
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
Permite seguir la ubicación en una aplicación WINDEV Mobile.
Ejemplo
// Enable the push notifications
geoTrackingEnable(ValidateTrackingActivation)
// Manage location tracking
PROCÉDURE ValidateTrackingActivation(bTrackingEnabled is boolean, cError is string)
IF NOT bTrackingEnabled THEN
Error(cError)
RETURN
END

STC_Loc = "Location enabled"
Sintaxis
geoTrackingEnable(<WLanguage procedure>)
<WLanguage procedure>: Nombre del procedimiento
Nombre del procedimiento WLanguage llamado:
  • cuando se realizó la desactivación,
  • si se produce un error:
    • iPhone/iPadIOS WidgetMac Catalyst solicitud de activación rechazada por el usuario.
    • Android error al acceder a los Servicios de Google Play.
Este procedimiento tiene el siguiente formato:
PROCEDURE <Procedure name>(<Tracking enabled> is boolean, <Error> is string)
  • El parámetro <Rastreo activo> es un booleano que indica si el rastreo está activo (True) o no (False).
  • <Error> es una cadena de caracteres correspondiente al texto del error de activación. Este parámetro se inicializa solo si el valor de <Seguimiento activado> es False.
Observaciones

Observaciones

  • Esta función es asíncrona.
  • iPhone/iPadIOS WidgetMac Catalyst Esta función sólo puede utilizarse si se han concedido los derechos de localización a la aplicación. Estos derechos se habilitan durante la generación.
  • Android A partir de Android 8, para reducir el consumo de batería de las aplicaciones, el sistema limita drásticamente la frecuencia de recepción de las ubicaciones de los dispositivos cuando la aplicación se ejecuta en segundo plano. Para obtener más información, consulte https://developer.android.com/about/versions/oreo/background-location-limits.
Android

Permisos necesarios

Android 11 specific case: This function requires the ACCESS_BACKGROUND_LOCATION permission to access the device's location.
This permission allows using the function when the application is in the background.
If the application needs to use background location:
  • Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
  • Explicitly request background location permission with PermissionRequest. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCEDURE Callback(p is Permission)
    	IF p.Granted THEN
    		// Functions that require background location access can be used
    	END
    END
A window allows users to:
  • allow access to the device location while the application is in the background,
  • allow access to the location only while the application is in use,
  • deny access to the location. The user can also change these permissions at any time in the Android settings.

Remarks:
  • Follow Google's guidelines for applications that require background location access. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. If these conditions are not met (especially user information requirements), applications may not be accepted for publication on Google Play.
  • The background location permission should only be requested if the location permission has been granted. Otherwise, PermissionRequest will fail.
  • If the option chosen by the user for the background location access request is more restrictive than the option chosen for the location access request, the application will be automatically restarted.
  • On devices running Android 10 or earlier, if location permission has been granted to the application, the background location permission will be granted without displaying a window.
Componente: wd300android.aar
Versión mínima requerida
  • Versión 21
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/09/2024

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