[英]Detect App idle timer/inactivity in nativescript?
我需要在 NativeScript 应用程序中检测用户的不活动时间。 任何帮助将不胜感激。
我已经尝试过以下链接: Detect App inactivity/idle timeout in NativeScript并能够在 android 中取得成功。 但是随着 android 的实现,我的 oAuth2 回调 Intent 已经停止工作。
其次,我完全坚持使用 Native Script 7 实现 iOS,因为我们无法在覆盖 AppDelegate 时分配自定义 window class。 如果有办法实现此功能,请提供帮助。
通过将以下代码添加到扩展的 android 活动,我能够修复我的 android oAuth2 回调问题:
public onNewIntent(intent: android.content.Intent) {
this._callbacks.onNewIntent(
this,
intent,
super.setIntent,
super.onNewIntent
);
}
对于 iOS,我在 app.component 内的 page-router-outlet 上添加了一个水龙头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.