簡體   English   中英

在 nativescript 中檢測應用程序空閑計時器/不活動?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM