怎么实现代理的方法呢 ?
有没有使用nativeJS 调用iOS原生定位的demo可以参考一下
写了一半不会写了
mui.plusReady(function() {
var self = plus.ios.currentWebview();
var CLLocationManager = plus.ios.import("CLLocationManager");
if(!CLLocationManager) {
console.log("CLLocationManager为空")
} else {
console.log("CLLocationManager:" + CLLocationManager);
}
var manager = new CLLocationManager();
if(!manager) {
console.log("manager为空");
} else {
console.log("manager:" + manager);
}
manager.desiredAccuracy = "kCLLocationAccuracyBest";
manager.distanceFilter = 10;
manager.delegate = self;
manager.startUpdatingLocation();
console.log("end");
//plus.invoke(manager,"startUpdatingLocation");
//实现代理方法
// plus.ios.implements("manage": { "locationManager" })
});**
0 个回复