Appearance
ESNetworkModule
getActiveNetworkInfo()
功能描述
获取网络状态。
参数
无
返回值
Object networkInfo
属性 | 类型 | 默认值 | 说明 |
---|---|---|---|
type | Number | `` | networkInfo.getType() |
typeName | String | `` | networkInfo.getTypeName() |
subtype | Number | `` | networkInfo.getSubtype() |
state | Number | `` | networkInfo.getState().ordinal() |
extraInfo | String | `` | networkInfo.getExtraInfo() |
isAvailable | Boolean | `` | networkInfo.isAvailable() |
isConnected | Boolean | `` | nnetworkInfo.isConnected() |
isConnectedOrConnecting | Boolean | `` | networkInfo.isConnectedOrConnecting() |
isFailover | Boolean | `` | networkInfo.isFailover() |
isRoaming | Boolean | `` | networkInfo.isRoaming() |
detailedState | Number | `` | networkInfo.getDetailedState() |
describeContents | Number | `` | networkInfo.describeContents() |
示例代码
点击查看源码
js
ESNetworkModule.getActiveNetworkInfo().then(
(networkInfo) => {
},
error => {
}
);
注意
无