Every time I open the application asks permission with a message “/private/var/mobile/Containers/Bundle/Application/XXXX/XXXXXXX/appname/www/index.html” Would Like To Use Your Current Location.
I need that message CHANGE, you mean like when the camera is used the question is simple without much text does not. And the other thing is I need it 1 time, ie when you first install the application and you, not every time you open it. Check the permissions and tells Location -> When used. And what I need is to tell FOREVER.
I hope you can help me.
I leave the list of plugin that I use and the code (I’m not using a geolocation plugin)
Cordova plugin ls
com.brodysoft.sqlitePlugin 0.7.1 "Cordova sqlite storage"
com.hutchind.cordova.plugins.launcher 0.2.2 "Launcher"
com.ionic.keyboard 1.0.3 "Keyboard"
com.lampa.startapp 0.0.4 "startApp"
com.ohh2ahh.plugins.appavailability 0.3.1 "AppAvailability"
hu.dpal.phonegap.plugins.PinDialog 0.1.2 "PinDialog"
nl.x-services.plugins.toast 2.0.2 "Toast"
org.apache.cordova.camera 0.3.6 "Camera"
org.apache.cordova.console 0.2.11 "Console"
org.apache.cordova.dialogs 0.3.0 "Notification"
org.apache.cordova.file 1.3.3 "File"
org.apache.cordova.inappbrowser 0.5.4-dev "InAppBrowser"
org.apache.cordova.network-information 0.2.15 "Network Information"
org.apache.cordova.splashscreen 0.3.3 "Splashscreen"
org.devgeeks.Canvas2ImagePlugin 0.6.0 "Canvas 2 Image"
Code :
<script type="text/javascript">
$(function(){
document.addEventListener("deviceready", onDeviceReady, false);
})
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
function onSuccess(position) {
console.log(position);
}
function onError(error) {
console.log(error);
}
</script>
Controller :
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
latitud_actual = position.coords.latitude;
longitud_actual = position.coords.longitude;
console.log(latitud_actual);
console.log(longitud_actual);
var mapOptions = {
center: new google.maps.LatLng(latitud_actual, longitud_actual),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
};
map = new google.maps.Map(document.getElementById("mapa_ubicacion"), mapOptions);
$scope.setMarker(map, new google.maps.LatLng(latitud_actual, longitud_actual), 'Yo', '');
});
}
thanks