Skip to content

Commit

Permalink
🐛 🔖 Ensure that the normal click works on android even if actions are…
Browse files Browse the repository at this point in the history
… present

In bhandaribhumin@0b6aefe,
the plugin started ignoring regular clicks when actions are present.

```
        Action[] actions = options.getActions();
        if (actions != null && actions.length > 0 ) {
          // if actions are defined, the user must click on button actions to launch the app.
          // Don't make the notification clickable in this case
          return;
        }
```

It is not clear why this was done. I have filed
bhandaribhumin#9
but not received any response

While waiting for it to be fixed in the main repo, commenting out that code in
a fork so that we can unblock out project.
  • Loading branch information
shankari committed Jun 11, 2023
1 parent 17826ea commit 86195b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-local-notification-12",
"version": "0.1.4",
"version": "0.1.4-fix-android-action",
"description": "Schedules and queries for local notifications",
"cordova": {
"id": "cordova-plugin-local-notification-12",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-local-notification-12"
version="0.1.4">
version="0.1.4-fix-android-action">

<name>LocalNotification</name>

Expand Down
7 changes: 1 addition & 6 deletions src/android/notification/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,6 @@ private void applyContentReceiver(NotificationCompat.Builder builder) {
return;

Action[] actions = options.getActions();
if (actions != null && actions.length > 0 ) {
// if actions are defined, the user must click on button actions to launch the app.
// Don't make the notification clickable in this case
return;
}

Intent intent = new Intent(context, clickActivity)
.putExtra(Notification.EXTRA_ID, options.getId())
Expand Down Expand Up @@ -493,4 +488,4 @@ private NotificationCompat.Builder findOrCreateBuilder() {
return builder;
}

}
}

0 comments on commit 86195b9

Please sign in to comment.