Geolocation work well on Browser but android device not working?


#1

We Use Geolocation Plugin for Fetching Location

No Problem on Browser

But

Android Device Location not fetched

Anyone Help Me >>


#2

Which android version? 8.x?


#3

cli packages: (C:\IONSTRE\node_modules)

@ionic/cli-utils  : 1.13.1
ionic (Ionic CLI) : 3.13.2

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.10
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.10.0
npm               : 3.10.10
OS                : Windows 10

Misc:

backend : pro

#4

ok… I meant the android OS version of the device. Is it Oreo and above?


#5

Testing device os Android 5.0 Lollipop


#6

Cordova geolocation plugin says >>

Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)." … "DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)


#7

When I ran into this issue it was because I was building a non-production version of my app. When you build your app for android, have you tried to include the --prod flag? Once I added that I was able to get a location response.