Android Send Notification event to JS only once when the app is in the foreground (#5620)

This commit is contained in:
Elias Nahum
2021-08-12 13:46:03 -04:00
committed by GitHub
parent faa3ee05ba
commit 8953f29623

View File

@@ -119,8 +119,9 @@ public class CustomPushNotification extends PushNotification {
switch (type) {
case PUSH_TYPE_MESSAGE:
case PUSH_TYPE_SESSION:
boolean createSummary = type.equals(PUSH_TYPE_MESSAGE);
if (!mAppLifecycleFacade.isAppVisible()) {
boolean createSummary = type.equals(PUSH_TYPE_MESSAGE);
if (type.equals(PUSH_TYPE_MESSAGE)) {
if (channelId != null) {
Map<String, List<Integer>> notificationsInChannel = loadNotificationsMap(mContext);
@@ -145,8 +146,6 @@ public class CustomPushNotification extends PushNotification {
}
buildNotification(notificationId, createSummary);
} else {
notifyReceivedToJS();
}
break;
case PUSH_TYPE_CLEAR: