Started the App with no data network and tried to detect current location using ionic geolocation plugin it failed (timeout error) as expected. I switched the data network and location service on (while app is running), then tried to detect current location using geolocation.getCurrentPosition(), still failing (timeout error). Tried this several time, no positive response. At the same time, I left data network & location service on, force closed the app and opened the app again, location service is working fine without any issues.
Could anybody tell me why this is happening and how to resolve this issue ?
Tried in Android phone.
Code
_cs.geolocation.getCurrentPosition({enableHighAccuracy: true, timeout: 4*1000, maximumAge: 0})
Ionic Info
global packages:
@ionic/cli-utils : 1.1.2
Cordova CLI : 6.5.0
Ionic CLI : 3.1.2
local packages:
@ionic/app-scripts : 1.3.1
@ionic/cli-plugin-cordova : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework : ionic-angular 2.3.0
System:
Node : v6.10.1
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
ios-sim : 5.0.13