简体   繁体   中英

Detect App idle timer/inactivity in nativescript?

I need to detect user's inactivity time in NativeScript app. 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. But with the android implementation my oAuth2 callbacks Intent had stopped working.

Secondly I am completely stuck on iOS implementation with Native Script 7 as we cannot assign Custom window class when overriding AppDelegate. 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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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