Reputation: 767
I want to use many locations to show on lock screen. I tested already, only 10 locations is shown. Are there any way to show more than 10 locations ?
Upvotes: 1
Views: 248
Reputation: 12581
Rachel is correct in that Passbook will only recognise the first 10 locations included in pass.json. If there are any more than 10, then these will be ignored.
The workaround that you link to, proposes the following:
Depending on how sophisticated you want to get in determining the most appropriate locations, it could be a bit of work. It also doesn't make for a great user experience since the location will eat battery and the constant updating of the pass will eat data.
Three alternative approaches are:
http://www.yourservice.com/?passSerial=xxxx
Sample location JS:
<script>
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(success,fail);
}
function success(a) {
$("#long").val(a.coords.longitude).focus(); // focus required to force an update of the field value in webkit browsers
$("#lat").val(a.coords.latitude).focus();
// initiate ajax callback to push new pass and alert the user that it is on the way
}
function fail() {
alert("You must give permission to provide your location, please refresh this page and try again");
}
</script>
Upvotes: 1