Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location permission alert on iPhone with PhoneGap

How do you change the string on the alert saying:

(Appname/whatever it is) would like to use your current location

Of course, I only want to change the appname part. Because when you use the PhoneGap framework, the string is very ugly, something like this:

/var/mobile/Applications/157EB70D-4AA7-826E-690F0CBE0F/appname.app/www/index.html

Someone having an idea?

like image 648
bolmaster2 Avatar asked Nov 04 '09 12:11

bolmaster2


1 Answers

You need to do the geolocation after the device is ready. The following Jquery code, for example, will geolocate without that nasty alert:

$(function(){   document.addEventListener("deviceready", onDeviceReady, false); })  function onDeviceReady() {   navigator.geolocation.getCurrentPosition(onSuccess, onError);      }  function onSuccess(position) {   // your callback here  }  function onError(error) {    // your callback here } 
like image 194
Pius Uzamere Avatar answered Oct 13 '22 23:10

Pius Uzamere