Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

No time to handle VoIP notification when phone is locked  #2389

Description

@HugoHeneault

Expected Behaviour

We should have some time to run JS code after VoIP notification has been received when device is locked. Like waiting for user to answer/reject a call.

Actual Behaviour

Time isn't given for js app to run on VoIP notification when phone is locked.
But when device is unlocked, even if the app is backgrounded, the js code runs for awhile when VoIP notification is received.

Reproduce Scenario (including but not limited to)

  • Setup an app receiving VoIP notif
  • Add a setInterval logging something every 50ms
  • When device is unlocked (with or without the app started), it runs
  • If the phone is locked (and app started) logging only runs once.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 11.3.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Apple iPhone SE

Cordova CLI version and cordova platform version

cordova --version                                    8.0.0
cordova platform version android                     4.5.4

Plugin version

phonegap-plugin-push 2.1.3 "PushPlugin"

But it's the version right after the VoIP has been merged, before the 2.2.0 has been released (I can't do the 2.2.0 migration because of cordova required version)

Sample Push Data Payload

{"message":"Test","title":"Test","additionalData":{"coldstart":false,"content-available":1,"foreground":false}}

Sample Code that illustrates the problem

Here is the code I run on('notification')

let i = 0;

setInterval(() => {
    console.log(++i);
}, 50);

Logs taken while reproducing problem

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