Skip to content

JS event 'resume' on Android 11 doesn`t work correctly during app start #1397

Open
@WiHa31

Description

@WiHa31

Issue Type

  • Bug Report
  • Feature Request
  • Support Question

Description

In my case:
When app runnig at first time after installation, callback into event listener on 'resume' event, doesn`t work.

Information

In my code i added evnetListener on window.document, with params ('resume', onResume, false ) and in case witch is described above, callback onResume doesn`t work. Reproducibility of case is constant. Problem appeared only at Android 11, same code work correctly at Android with lower os version. IOS working correctly.

Case:

  1. Install app
  2. Launch app
  3. Hide(minimize) app
  4. Tap on app icon again
    Result: callback doesnt work

You can repeat this case and there will be the same result while your app is on memory.
After unloading app from memory, and restart app problem dissapear.

When i change window.document.addEventListener('resume', ...) to window.document.onresume(...) - the problem continued.

Command or Code

const onResume = () => alert('resume event');
window.document.addEventListener('resume', onResume, false);

Environment, Platform, Device

Samsung Galaxy S20 Ultra, 11 Android - working incorrect
Samsung Galaxy A52, 11 Android - working incorrect

Nokia TA-1053, 10 Android - working correct
Samsung Galasy s9, 10 Android - working correct
iPhone 11, IOS 12.1 - working correct

Version information

Android 11
Cordova 10.0.0

Checklist

  • I searched for already existing GitHub issues about this
  • I updated all Cordova tooling to their most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions