You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ivan Penchev (JIRA)" <ji...@apache.org> on 2017/09/15 13:49:02 UTC
[jira] [Created] (CB-13286) plugin-geolocation fails , after 2 min,
in Huawei P9/10
Ivan Penchev created CB-13286:
---------------------------------
Summary: plugin-geolocation fails , after 2 min, in Huawei P9/10
Key: CB-13286
URL: https://issues.apache.org/jira/browse/CB-13286
Project: Apache Cordova
Issue Type: Bug
Components: cordova-plugin-geolocation
Affects Versions: cordova@7.0.0
Environment: 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"
Reporter: Ivan Penchev
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:
{code:JavaScriptl}
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);
}
{code}
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.
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
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org