forked from Ivasoft/mattermost-mobile
[Gekidou] Update Splash Screen / App icons and Android snooze Push Notifications (#5658)
* Android push notification snooze * Android splash & icons * iOS splash & icons * Update project assets * Replace iOS assets using Fastlane * Remove configure_telemetry_android from Fastlane script * Update Fastlane with master branch * Fix Android fastlane build * replace reference for com.mattermost.rnbeta.* imports * Set iOS ENTRY_FILE as index.ts
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package com.mattermost.rnbeta;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -53,10 +55,23 @@ public class CustomPushNotification extends PushNotification {
|
||||
return;
|
||||
}
|
||||
|
||||
notifications.remove(notificationId);
|
||||
saveNotificationsMap(context, notificationsInChannel);
|
||||
final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
||||
final NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
|
||||
notificationManager.cancel(notificationId);
|
||||
notifications.remove(notificationId);
|
||||
final StatusBarNotification[] statusNotifications = notificationManager.getActiveNotifications();
|
||||
boolean hasMore = false;
|
||||
for (final StatusBarNotification status : statusNotifications) {
|
||||
if (status.getNotification().extras.getString("channel_id").equals(channelId)) {
|
||||
hasMore = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasMore) {
|
||||
notificationsInChannel.remove(channelId);
|
||||
}
|
||||
|
||||
saveNotificationsMap(context, notificationsInChannel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user