File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
iterableapi/src/main/java/com/iterable/iterableapi Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ private void removeUnusedChannel(Context context) {
278278
279279 if (android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .O
280280 && mNotificationManager != null ) {
281- String channelIdToDelete = isNotificationBadgingEnabled (context ) ? context . getPackageName () + NO_BADGE : context . getPackageName ( );
281+ String channelIdToDelete = getOldChannelId (context );
282282 NotificationChannel unusedChannel = mNotificationManager .getNotificationChannel (channelIdToDelete );
283283 if (unusedChannel != null ) {
284284 for (StatusBarNotification activeNotification : mNotificationManager .getActiveNotifications ()) {
@@ -316,6 +316,14 @@ private static boolean isNotificationBadgingEnabled(Context context) {
316316 }
317317
318318 private String getChannelId (Context context ) {
319+ getChannelIdName (context , !isNotificationBadgingEnabled (context ))
320+ }
321+
322+ private String getOldChannelId (Context context ) {
323+ getChannelIdName (context , isNotificationBadgingEnabled (context ))
324+ }
325+
326+ private String getChannelIdName (Context context , boolean badgingEnabled ) {
319327 String channelId = context .getPackageName ();
320328 if (!isNotificationBadgingEnabled (context )) {
321329 channelId = channelId + NO_BADGE ;
You can’t perform that action at this time.
0 commit comments