用户在线状态

此接口提供有关用户当前是否在场的信息。检测在场的技术因平台而异。在移动平台上,只要应用程序处于前台,就假定用户在场。在网络平台上,如果窗口处于前台、选项卡是首要的,并且在过去一分钟内窗口内有鼠标或键盘活动,则假定用户在场。

方法

// Indicates whether the user is currently present
// On web platforms, it indicates whether the user has focused on the app and interacted with the app in the last 60 seconds
isUserPresent(): boolean;

事件

// Triggered when the user presence changes
userPresenceChangedEvent: SubscribableEvent<
    (isPresent: boolean) => void>();