diff --git a/android/app/src/main/java/chat/rocket/reactnative/CustomPushNotification.java b/android/app/src/main/java/chat/rocket/reactnative/CustomPushNotification.java index 07cab5e5b..dd2022687 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/CustomPushNotification.java +++ b/android/app/src/main/java/chat/rocket/reactnative/CustomPushNotification.java @@ -252,7 +252,9 @@ public class CustomPushNotification extends PushNotification { } private void notificationReply(Notification.Builder notification, int notificationId, Bundle bundle) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + String notId = bundle.getString("notId", "1"); + String ejson = bundle.getString("ejson", "{}"); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || notId.equals("1") || ejson.equals("{}")) { return; } String label = "Reply"; diff --git a/android/app/src/main/java/chat/rocket/reactnative/Ejson.java b/android/app/src/main/java/chat/rocket/reactnative/Ejson.java index cd18a292a..48c370370 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/Ejson.java +++ b/android/app/src/main/java/chat/rocket/reactnative/Ejson.java @@ -30,7 +30,7 @@ public class Ejson { public String serverURL() { String url = this.host; - if (url.endsWith("/")) { + if (url != null && url.endsWith("/")) { url = url.substring(0, url.length() - 1); } return url;