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
Post a Comment