Closed fgarciaand closed 6 months ago
The HMS log messages are harmless and expected when your app is first launched as the plugin executes methods to discover if the device is running on a device with GMS or HMS installed. They have nothing do do with your app crashing.
Your Environment
cordova -v
): 12.0.0 (cordova-lib@12.0.1)cordova platform ls
): android 12.0.1#ready
:// After deviceReady, initial configuration BackgroundGeolocation.ready({ debug: true, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, //Parámetros relacionados con la distancia y la localización desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 20, elasticityMultiplier: 1, stopOnTerminate: true, startOnBoot: false, url: ENDPOINT + 'tracking/trackUserLocation', extras: { id: userProfile.getId() }, preventSuspend: true, //Para IOS heartInterval: 60, notification: { title: 'MyApp', text: 'Verificando su seguridad', smallIcon: "mipmap/icon_notification", // <-- defaults to app icon color: '#122a36' }, //Permisos Android 11+ locationAuthorizationRequest: 'Always', backgroundPermissionRationale: { title: "¿Permitir que MyApp acceda a la ubicación de este dispositivo en segundo plano?", message: "Para realizar un seguimiento de su actividad en una situación de Emergencia, habilite el permiso de ubicación a permitir siempre", positiveAction: "Cambiar a permitir siempre", negativeAction: "Cancelar" }, locationAuthorizationAlert: { titleWhenNotEnabled: "Permisos para acceder a la ubicación desactivados", titleWhenOff: "Servicios de ubicación desactivados", instructions: "Para el correcto funcionamiento de MyApp debe habilitar 'Siempre' los servicios de ubicación", cancelButton: "Cancelar", settingsButton: "Configuración" } }).then((state) => { console.log("[ready] BackgroundGeolocation is configured and ready to use", state); }).catch(error => { console.log("[ready] BackgroundGeolocation.ready error: ", error); });
// When an event occurs and App is running in background BackgroundGeolocation.setConfig({ autoSync: true, maxRecordsToPersist: 1, stopAfterElapsedMinutes: 10, stopOnTerminate: false }).then(() => { //Inicio Trackeo en Background BackgroundGeolocation.start(function() { console.log("- Start success"); }); });