简体   繁体   English

在 nativescript 中检测应用程序空闲计时器/不活动?

[英]Detect App idle timer/inactivity in nativescript?

I need to detect user's inactivity time in NativeScript app.我需要在 NativeScript 应用程序中检测用户的不活动时间。 Any help will be appreciated.任何帮助将不胜感激。

I already tried following link: Detect App inactivity/idle timeout in NativeScript and was able to achieve success in android.我已经尝试过以下链接: Detect App inactivity/idle timeout in NativeScript并能够在 android 中取得成功。 But with the android implementation my oAuth2 callbacks Intent had stopped working.但是随着 android 的实现,我的 oAuth2 回调 Intent 已经停止工作。

Secondly I am completely stuck on iOS implementation with Native Script 7 as we cannot assign Custom window class when overriding AppDelegate.其次,我完全坚持使用 Native Script 7 实现 iOS,因为我们无法在覆盖 AppDelegate 时分配自定义 window class。 Please help if there is a way to achieve this functionality.如果有办法实现此功能,请提供帮助。

I was able to fix my android oAuth2 callbacks issues by adding below code to extended android activity:通过将以下代码添加到扩展的 android 活动,我能够修复我的 android oAuth2 回调问题:

public onNewIntent(intent: android.content.Intent) {
this._callbacks.onNewIntent(
  this,
  intent,
  super.setIntent,
  super.onNewIntent
);

} }

For iOS I went with adding a tap on page-router-outlet inside app.component.对于 iOS,我在 app.component 内的 page-router-outlet 上添加了一个水龙头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM