Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
cordova@7.0.0
-
None
-
None
-
cordova -v 7.0.1
Installed platforms:
android 6.1.0
com.phonegap.plugins.nativesettingsopener 1.2 "Native settings"
cordova-plugin-background-mode 0.6.6-dev "BackgroundMode"
cordova-plugin-bluetooth-serial 0.4.6 "Bluetooth Serial"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.0 "Notification"
cordova-plugin-file 4.3.1 "File"
cordova-plugin-geolocation 2.4.1 "Geolocation"
cordova-plugin-googlemaps 1.4.0 "phonegap-googlemaps-plugin"
cordova-plugin-mauron85-background-geolocation 2.2.4 "CDVBackgroundGeolocation"
cordova-plugin-media 2.4.1 "Media"
cordova-plugin-network-information 1.3.0 "Network Information"
cordova-plugin-splashscreen 4.0.1 "Splashscreen"
cordova-plugin-vibration 2.1.2 "Vibration"
cordova-plugin-whitelist 1.3.0 "Whitelist"
cordova-plugin-x-toast 2.5.2 "Toast"
cordova.plugins.diagnostic 3.2.1 "Diagnostic"
de.appplant.cordova.plugin.local-notification 0.8.2dev "LocalNotification"
phonegap-plugin-push 1.10.5 "PushPlugin"cordova -v 7.0.1 Installed platforms: android 6.1.0 com.phonegap.plugins.nativesettingsopener 1.2 "Native settings" cordova-plugin-background-mode 0.6.6-dev "BackgroundMode" cordova-plugin-bluetooth-serial 0.4.6 "Bluetooth Serial" cordova-plugin-compat 1.1.0 "Compat" cordova-plugin-console 1.0.5 "Console" cordova-plugin-datepicker 0.9.3 "DatePicker" cordova-plugin-device 1.1.4 "Device" cordova-plugin-dialogs 1.3.0 "Notification" cordova-plugin-file 4.3.1 "File" cordova-plugin-geolocation 2.4.1 "Geolocation" cordova-plugin-googlemaps 1.4.0 "phonegap-googlemaps-plugin" cordova-plugin-mauron85-background-geolocation 2.2.4 "CDVBackgroundGeolocation" cordova-plugin-media 2.4.1 "Media" cordova-plugin-network-information 1.3.0 "Network Information" cordova-plugin-splashscreen 4.0.1 "Splashscreen" cordova-plugin-vibration 2.1.2 "Vibration" cordova-plugin-whitelist 1.3.0 "Whitelist" cordova-plugin-x-toast 2.5.2 "Toast" cordova.plugins.diagnostic 3.2.1 "Diagnostic" de.appplant.cordova.plugin.local-notification 0.8.2dev "LocalNotification" phonegap-plugin-push 1.10.5 "PushPlugin"
Description
Logic of the program:
<get POI from servers> if CurrentLocation is close to POI <sound Notification>
Important to notice is this bug happens on only Some phones (Mostly Huawei P9/10), as same code runs perfectly on my S6.
Logic implemntation:
function onAppReady() { build_dom(); gps_watch(); if IOS ..... If Android .... } function gps_watch() { var options = { enableHighAccuracy: true, timeout: 30000 } gps_watch_handle = navigator.geolocation.watchPosition( location_received, function(obj) { some code here... basically it says to restart the gps_watch() }, , options ); } function location_received(position) { if IOS .... do this If Android do this... basic logic is we create an data source with which we can compare. pos = new Array(position.coords.latitude, position.coords.longitude, position.coords.accuracy, position.coords.speed, position.coords.heading); }
So far I tried to debug something in the console:
this is what I have:
within gps_watch method
within location_received method
>>> Latitude: 57.023577388
within location_received method
>>> Latitude: 57.023596579
this above repeate for about 2 minutes (which is how it should behave).
Then it stops:
within location_received method
>>> Latitude: 57.023733988
within location_received method
No errors no nothing. I tried manually to start the gps_watch method (just added a button with that method attached as onClick) this happens:
within gps_watch method
within error function in gps_watch method
within gps_watch method
within error function in gps_watch method
and this repeate.
EDIT: in the error function object, which I receive after I manually click on the gps_watch method with the button I greated lies this:
body:::gps error: Timeout expired
code:::gps errorcode: 3
As you can see I am a novice developer, I would appreciate any guides into how to solve/further debug this issue.
Thank you,
Ivan