1

I have some issues with a phonegap application using the geolocation of the user. Everytime the page is opened in the app, we get the following messageError Message on iOS

It would be nice, to prevent the app of showing this hint.

We use Cordova 1.9, PhoneGap Build and have set the right in the config.xml to access the position:

<feature name="http://api.phonegap.com/1.0/geolocation"/>

We cannot make deep changes in the objectiv-c code like described here because we use PhoneGap Build!

My code looks like the following...

function onDeviceReady() {

    // get position
    if (watchId == null) {
        killWatcher();
        window.setTimeout(function() {
            navigator.geolocation.getCurrentPosition(updateUserPosition, log, {
                enableHighAccuracy: false
            });
            watchId = navigator.geolocation.watchPosition(updateUserPosition, onGPSError, {
                frequency : 5000,
                maximumAge : 30000,
                enableHighAccuracy : true
            });
            localStorage.setItem("watchID", watchId);
        }, 1000);
    }
}

The function listens on the ondeviceready event.

Does anyone have an idea how to fix that?

Thank you!

Community
  • 1
  • 1
Sebastian
  • 1,873
  • 4
  • 25
  • 57

1 Answers1

0

Ok the problem here was that Cordova.js was not included on all pages.

Sebastian
  • 1,873
  • 4
  • 25
  • 57