Preparing search index...
The search index is not available
IM SDK Web API 文档
IM SDK Web API 文档
platform/types
RuntimeAdapter
Interface RuntimeAdapter
宿主运行时能力适配器。
interface
RuntimeAdapter
{
getPlatform
()
:
RuntimePlatform
;
getNetworkType
()
:
Promise
<
string
|
number
>
;
onNetworkChange
(
listener
:
(
online
:
boolean
)
=>
void
)
:
()
=>
void
;
onAppVisibilityChange
(
listener
:
(
foreground
:
boolean
)
=>
void
)
:
()
=>
void
;
}
Index
Methods
get
Platform
get
Network
Type?
on
Network
Change
on
App
Visibility
Change
Methods
get
Platform
getPlatform
()
:
RuntimePlatform
获取当前运行平台。
Returns
RuntimePlatform
Optional
get
Network
Type
getNetworkType
()
:
Promise
<
string
|
number
>
获取当前网络类型;无法获取时可以省略该能力。
Returns
Promise
<
string
|
number
>
on
Network
Change
onNetworkChange
(
listener
:
(
online
:
boolean
)
=>
void
)
:
()
=>
void
监听网络状态并返回取消函数。
Parameters
listener
:
(
online
:
boolean
)
=>
void
Returns
()
=>
void
on
App
Visibility
Change
onAppVisibilityChange
(
listener
:
(
foreground
:
boolean
)
=>
void
)
:
()
=>
void
监听应用前后台状态并返回取消函数。
Parameters
listener
:
(
foreground
:
boolean
)
=>
void
Returns
()
=>
void
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
On This Page
Methods
get
Platform
get
Network
Type
on
Network
Change
on
App
Visibility
Change
IM SDK Web API 文档
Loading...
宿主运行时能力适配器。