html5 - App doesn't geolocate after installation on FF OS -
i've written web app firefox mobile / firefox os. app uses geolocation.
it worked when tested firefox android , ffos simulator add-on visiting web address of application. i've passed firefox marketplace review , app installable on ffos , firefox android. surprise, when installed , ran it, geolocation didn't work.
here's excerpt .webapp file:
"permissions": { "geolocation": { "description": "required ....." } } here's relevant part of js:
if(navigator.geolocation) { navigator.geolocation.getcurrentposition(positionfound, positionnotfound, { enablehighaccuracy: false, maximumage: 3600000 }); } else { $('#location').html('no geolocation support'); } the else block not executed, js detects geolocation exists, callback never called, , gps icon never blinks.
the app still works , positionfound() called when accessed via url, not installed app.
how can make geolocate after installation?
the following code works us, gps functionality severely limited on geeksphone ffos 1.2 nightly builds agps on ffos 1.0 (time first fix ~ 5min). geolocation api requires frequent reboots on our devices. us, ffos 1.1 worked best far. try use 1 of existing gps apps "gpsdashboard" before starting app. way know phone working.
function geo_success(position) { alert(position.coords.longitude); } function geo_error() { alert("sorry, no position available."); } var geo_options = { enablehighaccuracy: true, maximumage : 300000, timeout : 270000 }; navigator.geolocation.watchposition(geo_success, geo_error, geo_options); do callback functions work fake data?
Comments
Post a Comment