Device: Android
Target Version: 25
Cordova version: 7.0.1
I'm using cordova-plugin-geolocation https://www.npmjs.com/package/cordova-plugin-geolocation but with some devices doesn't work. I tried the application with these devices:
- Huawei P9 Lite VNS-L31 Android 7.0 ---> work
- Huawei P9 Lite VNS-L21 Android 7.0---> work only if i disallow the battery optimization of the application.
- Huawei P9 Android 7.0--> doesn't work
- One Plus 3 Android 7.1.1 --> work
- Samsung S8 Android 7.0 --> work
CODE:
navigator.geolocation.getCurrentPosition(onSuccessPoint, onErrorPoint,{ timeout:10000 });
var onSuccessPoint = function (position) {
///SUCCESS CODE
}
function onErrorPoint(error) {
//ERROR CODE
}