You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/09/08 12:47:29 UTC

[GitHub] [cordova-plugin-geolocation] kapilSoni101 opened a new issue #175: Ionic 3 : geolocation.watchPosition not getting fired in some Android version 9 devices?

kapilSoni101 opened a new issue #175: Ionic 3 : geolocation.watchPosition not getting fired in some Android version 9 devices?
URL: https://github.com/apache/cordova-plugin-geolocation/issues/175
 
 
   Hi team,
   
   I have implemented tracking functionality in ionic3 app its working perfectly in all android version below 9 but in some android 9 version devices its not working.
   
   So lets start,after testing my App on four real devices, I distinguished three different behaviors:
   
   Android 7.1.x (Redmi MI 4A) => working Correctly
   
   Android 9 => I checked in 2 different devices both are android 9 version 1st "Nokia 6" in which watchPosition fired properly but in the other device - Oppo F11 -pro watchPosition function didn't fire.
   have implemented tracking functionality in ionic3 app its working perfectly in all android version below 9 but in some android 9 version devices its not working.
   
   So lets start,after testing my App on four real devices, I distinguished three different behaviors:
   
   Android 7.1.x (Redmi MI 4A) => working Correctly
   
   Android 9 => I checked in 2 different devices both are android 9 version 1st "Nokia 6" in which watchPosition fired properly but in the other device - Oppo F11 -pro watchPosition function didn't fire.
   
   /getLocationModeForIos for execute only for IOS
     getLocationMode() {
       var self = this;
          //if map exist..
       if(self.mapElement) { 
         self.platform.ready().then((readySource) => {
   
           //
          let mapOptions = {
             zoom: 13,
             mapTypeId: google.maps.MapTypeId.ROADMAP,
             mapTypeControl: false,
             streetViewControl: false,
             fullscreenControl: false,
             draggable : true
           } 
   
   
            self.map = new google.maps.Map(self.mapElement.nativeElement, mapOptions);  
   
            //get user currentLocation and update user location after move move    
            self.watch = self.geolocation.watchPosition();
            self.subscription = self.watch.subscribe((position) => {
             var latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
   
             console.log('lat fire1.....', +position.coords.latitude);
             console.log('long fire.....', +position.coords.longitude);
             //set center to map and set zoom....
             self.map.setCenter(latLng);
             self.map.setZoom(16);
           }, (err) => {
               console.log(err);
           });
         });
       }
    have tried everything but nothing worked for me. Please check my code and tell me what is wrong in my code?
   
   
   ## Environment, Platform, Devic# Version
   <!-- 
   Cordova:7.0.0 Android:- 6.4.0
   -->
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org