I have a Sencha app which performs geolocation, and provides a list of nearby venues based on the results.
I am using PhoneGap:Build (the automated service); this point might be of importance. I am not dealing with the PhoneGap files at all - I am letting PhoneGap:Build automatically create the apps for all platforms. So far it has been spectacular.
The problem: I understand that attempting to geolocate before 'deviceready' is triggered may result in a geolocation call using the Safari geolocation instead of the device geolocation. The side-effect I am experiencing is this terrible message prompt:
'/var/mobile/Applications/XXXX-XXXX-XXXX-XXXXXXXXXXX/AppName.app/www/index.html would like to use your current location'
Now, this is still happening after I introduce even a 10 second delay - long enough to ensure that PhoneGap has long since been loaded. This is where I am confused. This only happens in iOS; Android build seems fine.
Why am I getting this message? I have the following line in my config.xml:
<feature name="http://api.phonegap.com/1.0/geolocation"/>
..Which I figured was sufficient to open up the PhoneGap geolocation API, thus avoiding this horrible message.
I should also note that I get double prompted; the first time geolocation is performed, I get this:
'App Name would like to use your location'
Which is then followed by a second message - the ugly one I outlined above.
Why are two prompts being displayed back-to-back? Why not just the first one? I've spent days on this.. completely out of ideas. Please help!