04 手机系统定位模块 - MiEcosystem/miot-plugin-sdk GitHub Wiki
扩展程序运行时手机系统提供的定位功能,主要包括定位权限的获取,获取当前定位(不同精度),位置信息更新事件等方法
Export: public
Doc_name: 手机系统定位模块
Doc_index: 4
Doc_directory: system
Example
import {System} from 'miot'
System.location.getLocation({accuracy:1}).then(res=>{
console.log(res)
})
Host事件集合
Kind: inner namespace of miot/system
Example
import { HostEvent } from 'miot/host';
const subscription = HostEvent.cellPhoneNetworkStateChanged.addListener(
(event)=>{
...
}
)
...
subscription.remove()
...