Commit d01c621b by Sebastián Katzer

Do not fire `clear` or `cancel` event when clicked on persistent notifications

parent b8d9e142
...@@ -6,6 +6,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo ...@@ -6,6 +6,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
#### Version 0.8.1 (not yet released) #### Version 0.8.1 (not yet released)
- Fire `clear` instead of `cancel` event when clicked on repeating notifications - Fire `clear` instead of `cancel` event when clicked on repeating notifications
- Do not fire `clear` or `cancel` event when clicked on persistent notifications
### Version 0.8.0 (05.03.2015) ### Version 0.8.0 (05.03.2015)
......
...@@ -43,9 +43,11 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click ...@@ -43,9 +43,11 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click
public void onClick(Notification notification) { public void onClick(Notification notification) {
LocalNotification.fireEvent("click", notification); LocalNotification.fireEvent("click", notification);
String event = notification.isRepeating() ? "clear" : "cancel"; if (!notification.getOptions().isOngoing()) {
String event = notification.isRepeating() ? "clear" : "cancel";
LocalNotification.fireEvent(event, notification); LocalNotification.fireEvent(event, notification);
}
super.onClick(notification); super.onClick(notification);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment