Skip to content

Commit

Permalink
chore(push-notifications): Update firebaseMessagingVersion default va…
Browse files Browse the repository at this point in the history
…lue (#2259)
  • Loading branch information
jcesarmobile authored Nov 25, 2024
1 parent 482fb11 commit 9f036e3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion push-notifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Android 13 requires a permission check in order to receive push notifications.

This plugin will use the following project variables (defined in your app's `variables.gradle` file):

- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `23.3.1`)
- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`)

---

Expand Down
2 changes: 1 addition & 1 deletion push-notifications/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ext {
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '23.3.1'
firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '24.1.0'
}

buildscript {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,31 @@ public void unregister(PluginCall call) {
@PluginMethod
public void getDeliveredNotifications(PluginCall call) {
JSArray notifications = new JSArray();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();

for (StatusBarNotification notif : activeNotifications) {
JSObject jsNotif = new JSObject();
for (StatusBarNotification notif : activeNotifications) {
JSObject jsNotif = new JSObject();

jsNotif.put("id", notif.getId());
jsNotif.put("tag", notif.getTag());
jsNotif.put("id", notif.getId());
jsNotif.put("tag", notif.getTag());

Notification notification = notif.getNotification();
if (notification != null) {
jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
jsNotif.put("group", notification.getGroup());
jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));
Notification notification = notif.getNotification();
if (notification != null) {
jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
jsNotif.put("group", notification.getGroup());
jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));

JSObject extras = new JSObject();
JSObject extras = new JSObject();

for (String key : notification.extras.keySet()) {
extras.put(key, notification.extras.getString(key));
}

jsNotif.put("data", extras);
for (String key : notification.extras.keySet()) {
extras.put(key, notification.extras.getString(key));
}

notifications.put(jsNotif);
jsNotif.put("data", extras);
}

notifications.put(jsNotif);
}

JSObject result = new JSObject();
Expand Down

0 comments on commit 9f036e3

Please sign in to comment.