APP想做一个每1分钟获取定位
这配置了"UIBackgroundModes" : "audio,location";
"
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady() {
plus.geolocation.watchPosition(function(p) {
console.log(p.coords.latitude+','+p.coords.longitude);
var url = AppUrl + 'setLocation';
mui.getJSON(url, {latitude: p.coords.latitude,longitude:p.coords.longitude,user:user,address:p.addresses}, function(data) {
})
}, function(e) {
console.log(e.message);
},{maximumAge:60000});
}
"
0 个回复