Host - blockdate/ios-rn-sdk GitHub Wiki
扩展程序运行时的宿主环境
所有由宿主APP直接提供给扩展程序的接口均列在这里. 主要包括原生业务页面, 本地数据访问等
Export:
Example
import {Host} from 'miot'
Host.type // ios/ android/ tv
Host.isIOS
Host.isAndroid
Host.version
Host.apiLevel
Host.isDebug
Host.ui.openDeviceListPage()
Host.ui.openShopPage(100)
Host.locale.language
Host.locale.timezone
Host.locale.currentTimeMillis.then(time=>{})
Host.locale.getCurrentCountry().then(country=>{})
Host.locale.getPlaceMark().then(place=>{})
Host.locale.getGPS().then(gps=>{})
Host.file.readFile(path).then(file=>{})
Host.file.writeFile(path, file).then(ok=>{})
Host.storage.get(key)
Host.storage.set(key, value)
-
miot/Host
-
.type :
string
-
.systemInfo ⇒
object
-
.isAndroid :
boolean
- .isIOS
-
.version :
string
-
.apiLevel :
int
-
.isDebug :
boolean
- .ui
- .locale
- .storage
- .file
- .audio
- .crypto
-
.getWifiInfo() ⇒
Promise
-
.type :
返回本地环境的类型, ios|android
Kind: static constant of miot/Host
系统信息
Kind: static constant of miot/Host
Returns: object
- 包含sysVersion 系统版本名称 mobileModel 手机型号
判断是否是 android
Kind: static constant of miot/Host
判断是否 iOS
Kind: static constant of miot/Host
APP 的版本, 例如"1.0.0"
Kind: static constant of miot/Host
APP 的 apiLevel
Kind: static constant of miot/Host
判断是否是调试版本
Kind: static constant of miot/Host
Read only: true
可调起的host业务页面
Kind: static constant of miot/Host
See: module:miot/host/ui
host 的本地化设置, 包括语言,地区,城市等等
Kind: static constant of miot/Host
See: module:miot/host/locale
本地数据存储服务模块
Kind: static constant of miot/Host
See: module:miot/host/storage
本地文件服务模块
Kind: static constant of miot/Host
See: module:miot/host/file
音频 播放,录制,转码相关模块
Kind: static constant of miot/Host
See: module:miot/host/audio
加密解密模块
Kind: static constant of miot/Host
See: module:miot/host/crypto
获取手机wifi信息
Kind: static method of miot/Host
Example
Host.getWifiInfo().then(res => console("ssid and bssid = ", res.SSID, res.BSSID))