Skip to content

Commit 3a6ff18

Browse files
committed
Merge branch 'davidtruong-showBadge-update' into MOB-3970-NEW-SetShowBadge
# Conflicts: # iterableapi/src/main/java/com/iterable/iterableapi/IterableNotificationHelper.java
2 parents f7011c0 + ef63646 commit 3a6ff18

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableNotificationHelper.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)