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/07/15 16:59:51 UTC

[GitHub] [cordova-plugin-geolocation] ioclaudio opened a new issue #170: Timeout expired error on some devices

ioclaudio opened a new issue #170: Timeout expired error on some devices
URL: https://github.com/apache/cordova-plugin-geolocation/issues/170
 
 
   I have a problem with an Ionic4 app that uses geolocation on some devices with Android 9.
   
   Running this code on a One Plus One mobile phone, the device asks for permission to use the geolocation.
   If I click on "Confirm" the plugin returns the error:
   ```
   PositionError {code: 3, message: "Timeout expired"}
   code: 3
   message: "Timeout expired"
   __proto__: PositionError
   ```
   
   This is the code I'm using:
   `    
   	const geo_options = {
   		enableHighAccuracy: true,
   		timeout: 20000,
   		maximumAge: 0
   	};
   
   	this.geolocation.getCurrentPosition(geo_options).then((resp) => {
   		console.log('coordinates OK: ', this.coordinates);
   		....
   	}).catch((error) => {
   		console.log(error)
   		...
   
   	}
   `
   
   In the settings of the mobile phone, I can see that the app has permission for using the geolocation.
   So why it doesn't give the geolocation coordinates?
   How can I debug better this situation?
   
   This is the setup of the system:
   `
   >ionic info
   Ionic:
      Ionic CLI                     : 5.2.1 
      Ionic Framework               : @ionic/angular 4.3.0
      @angular-devkit/build-angular : 0.13.9
      @angular-devkit/schematics    : 7.2.4
      @angular/cli                  : 7.3.8
      @ionic/angular-toolkit        : 1.5.1
   Cordova:
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : android 8.0.0, ios 5.0.1
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 11 other plugins)
   Utility:
      cordova-res : 0.6.0
      native-run  : 0.2.2
   System:
      Android SDK Tools : 26.1.1 
      NodeJS            : v10.15.3
      npm               : 6.9.0
      OS                : Windows 10
   `
   
   These are the Cordova plugins installed:
   `
   >cordova plugin list
   cordova-plugin-camera 4.0.3 "Camera"
   cordova-plugin-device 2.0.2 "Device"
   cordova-plugin-file 6.0.1 "File"
   cordova-plugin-geolocation 4.0.1 "Geolocation"
   cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
   cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
   cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
   cordova-plugin-ionic-webview 4.1.0 "cordova-plugin-ionic-webview"
   cordova-plugin-ios-disableshaketoedit 1.0.0 "iOS Disable Shake to Edit"
   cordova-plugin-mauron85-background-geolocation 3.0.3 "CDVBackgroundGeolocation"
   cordova-plugin-splashscreen 5.0.2 "Splashscreen"
   cordova-plugin-statusbar 2.4.2 "StatusBar"
   cordova-plugin-whitelist 1.3.3 "Whitelist"
   phonegap-plugin-barcodescanner 8.0.1 "BarcodeScanner"
   `

----------------------------------------------------------------
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