I'm creating an ios app with phonegap 3.2 I need users current location to search nearby users. When i tried to get current location of device with code
function onSuccess(position) {
device_lat = position.coords.latitude;
device_long = position.coords.longitude;
}
// onError Callback receives a PositionError object
function onError(error) {
alert("Share Your Location First.");
}
function onDeviceReady()
{
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
A confirm box appearing with following text. "/Users/../Library/Application Support/iPhone Simulators/6.1/Applications/[App Code here]/demo.app/www/index.html" Would Like To Use Your Current Location.
Is it possible to costomise this text as its say Like "MyApp Would Like To Use Your Current Location" ?
Also for android and other devices.
I'm posting a new answer since the last one was incomplete. In order to get the geolocation prompt title to show your app name and not the full path to the file you'll need to do two things:
Install the Cordova / PhoneGap geoLocation pluin (cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git)
Run the getCurrentPosition after deviceready has been fired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With