Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13286

plugin-geolocation fails , after 2 min, in Huawei P9/10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • cordova@7.0.0
    • None
    • None

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            thefolenangel Ivan Penchev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: