diff --git a/packages/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java b/packages/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java index 80ac0e61b3674..c15cc8fd7191d 100644 --- a/packages/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java +++ b/packages/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java @@ -91,17 +91,15 @@ private static Bundle toBundle(@Nullable JSONObject notification) { Iterator keyIterator = notification.keys(); while (keyIterator.hasNext()) { String key = keyIterator.next(); - try { - Object value = notification.get(key); - if (value instanceof JSONObject) { - notificationMap.put(key, toBundle((JSONObject) value)); - } else if (value instanceof JSONArray) { - notificationMap.put(key, toList((JSONArray) value)); - } else if (value != null) { - notificationMap.put(key, value); - } - } catch (JSONException e) { - Log.e("expo-notifications", "Could not serialize whole notification - dropped value for key " + key + ": " + notification.opt(key)); + Object value = notification.opt(key); + if (value instanceof JSONObject) { + notificationMap.put(key, toBundle((JSONObject) value)); + } else if (value instanceof JSONArray) { + notificationMap.put(key, toList((JSONArray) value)); + } else if (JSONObject.NULL.equals(value)) { + notificationMap.put(key, null); + } else { + notificationMap.put(key, value); } } return new MapArguments(notificationMap).toBundle();