cordova - Geolocation plugin permission alert on iPhone with PhoneGap -


two time alert show first alert correct second alert generate string use current location.

how change string on alert saying: /var/mobile/applications/157eb70d-4aa7-826e-690f0cbe0f/appname.app/www/index.html

someone having idea?

try use following code on device ready:

document.addeventlistener('deviceready', ondeviceready, false);  function ondeviceready() {    navigator.geolocation.getcurrentposition(onsuccess, onerror); }  function onsuccess(position) {    //retrieve latitude as: alert(position.coords.latitude);    //retrieve longitude as: alert(position.coords.longitude); }  function onerror(error) {    console.log('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); } 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -