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

(cherry picked from commit 8953f29623)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2021-08-12 20:29:36 +02:00 committed by GitHub
parent b9179b0774
commit 4549ecdd94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: