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

Actionable alert event listener stopped working on iOS (2.3.0) #2889

Open
sckumar opened this issue Mar 16, 2020 · 3 comments
Open

Actionable alert event listener stopped working on iOS (2.3.0) #2889

sckumar opened this issue Mar 16, 2020 · 3 comments

Comments

@sckumar
Copy link

sckumar commented Mar 16, 2020

Expected Behaviour

iOS actionable alert event listener should get called when user taps on action from the background push notification
pushObject.on("Approve").subscribe(notification => {
console.log("approved" + notification);
});

Actual Behaviour

Rather than calling actionable alert event, it triggers pushObject.on("registration").subscribe((registration: any) => {
console.log(notification.additionalData.foreground); // false
}

Reproduce Scenario (including but not limited to)

Run the application on iOS 13.0 and above

Steps to Reproduce

  1. Register with categories
  2. Send actionable alert with push notification
  3. Perform action from background push notification

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

iOS 13.x

Cordova CLI version and cordova platform version

Cordova version
9.0.3 ([email protected])
Platform versions
android 8.1.0
ios 5.1.1

Plugin version

2.3.0

Sample Push Data Payload

{
"aps": {
"category": "authorize",
"title": "Payment is pending for approval",
"alert": "Payment of 3500 EUR is pending for your approval"
},
"actionInfo": {
"currentAction": "add",
"nextAction": "approve",
"referenceId": "11U5F1lGesVcxzo",
"rejectionInfo": null
}
}

Sample Code that illustrates the problem

this.platform.ready().then(() => {
const options: PushOptions = {
android: {},
windows: {},
ios: {
alert: "true",
badge: true,
sound: "true",
categories: {
authorize: {
yes: {
callback: "Approve",
title: "Approve",
foreground: true,
destructive: false
},
no: {
callback: "Reject",
title: "Reject",
foreground: true,
destructive: true
}
}
}
};
this.pushObject = this.push.init(options);
this.pushObject.on("registration").subscribe((registration: any) => {
}
this.pushObject.on("notification").subscribe((notification: any) => {
}
this.setCallbacks(this.pushObject);
});
setCallbacks(pushObject) {
pushObject.on("Approve").subscribe(notification => {
console.log("approved" + notification);
});
pushObject.on("Reject").subscribe(notification => {
console.log("approved" + notification);
});
}

Logs taken while reproducing problem

@sckumar
Copy link
Author

sckumar commented Apr 23, 2020

Can anyone please help me with this ?

@razam217
Copy link

@sckumar did you find any solution to this issue? I'm facing similar issue. I've also created a ticket #2916.

@rcavaliere-tootelo
Copy link

Anybody ? I heard it was working before. I can't get it to work iOS 10.x.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants