Cannot use PhoneGap geolocation API; Instead, Safari is used. A nasty geolocation tooltip appears

I have a Sencha application that performs geolocation and provides a list of the nearest centers based on the results.

I use PhoneGap: Build (automated service); this moment may matter. I do not deal with PhoneGap files at all - I allow PhoneGap: automatically create applications for all platforms. So far it has been exciting.

Problem: I understand that trying to geolocate before running the "deviceready" function can result in a geolocation call using Safari geolocation instead of device geolocation. The side effect I'm experiencing is a scary message:

'/var/mobile/Applications/XXXX-XXXX-XXXX-XXXXXXXXXXX/AppName.app/www/index.html would like to use your current location' 

Now this happens when I introduced even a 10 second delay - long enough to ensure that PhoneGap has been loaded for a long time. Here I am confused. This only happens on iOS; Android build seems fine.

Why am I receiving this message? I have the following line in config.xml:

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

. Something I realized was enough to open the PhoneGap geolocation API, thereby avoiding this horrible message.

I should also note that I receive a double invitation; the first geolocation is done, I get the following:

 'App Name would like to use your location' 

Then comes the second message - the ugly one that I mentioned above.

Why are two prompts displayed back to each other? Why not just the first? I spent a few days on it ... completely out of ideas. Please, help!

+4
source share
1 answer

The same problem is fixed here .

Mostly they take you here again.

which explains a rather deep process, but at least it works.

+1
source

Source: https://habr.com/ru/post/1391182/


All Articles