cordovaionic-frameworkgpsngcordovaandroid-gps

How to use Cordova Geolocation plugin in offline mode


I'm using ngCordova Geolocation plugin in my ionic1 app. It gives me latitude and longitude only when I'm connected to wifi or mobile data. How can I do this work offline?

The error message for offline mode:

Network location provider at 'https://www.googleapis.com/' : No response received

NOTE: I searched and someone has said that I must use this option:

enableHighAccuracy: true

But no diffrenece.

EDIT: I found out it works somehow in real device. But not always. It's searching for gps but just sometimes it can find. Any idea?


Solution

  • I almost found the problem. I must test the Geolocation plugin out of a department, otherwise the gps can not find my location.

    Inside department, it can find hardly ever (almost never), but with internet connection. Out of department it works in offline mode.