离子2 - 检测屏幕是否已锁定



我搜索了很长时间,找不到任何结果。

我需要 Ionic 2 中的事件或方法来检查手机显示屏的统计信息 - 显示屏是锁定还是解锁。

另一种选择是检查用户是否处于活动状态。但认为锁屏会更好。

尝试使用平台自定义

constructor( private platform: Platform ) {
platform.ready().then(() => {    
this.platform.pause.subscribe(() => {
console.log('[INFO] App paused');
});
this.platform.resume.subscribe(() => {
console.log('[INFO] App resumed');
});
});

}

最新更新