【问题标题】:how to check app running in foreground or background in cordova specially on ios platform (onResume and onPause not working for me)如何在 ios 平台上检查在科尔多瓦的前台或后台运行的应用程序(onResume 和 onPause 对我不起作用)
【发布时间】:2019-08-20 02:18:15
【问题描述】:

我通过以下链接为我的 cordova 应用程序实现了以下解决方案,它适用于 android 但不适用于 ios 平台 onPause 和 onResume 事件在 ios 上不起作用。

how to check app running in foreground or background in ionic/cordova/phonegap

【问题讨论】:

    标签: ios cordova onresume hybrid onpause


    【解决方案1】:

    我相信 API 已更新为暂停和恢复

     document.addEventListener("pause", onPause, false);
     document.addEventListener("resume", onResume, false);
    

    没有你的代码很难说

    在此处查看文档:https://cordova.apache.org/docs/en/9.x/cordova/events/events.html#page-toc-source

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-11
      • 2018-06-03
      • 2021-11-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多