Skip to content

Commit 6499668

Browse files
Changes as per comment
1 parent 515e809 commit 6499668

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app/src/org/commcare/CommCareNoficationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class CommCareNoficationManager {
4040
public static final String NOTIFICATION_CHANNEL_USER_SESSION_ID = "notification-channel-user-session";
4141
public static final String NOTIFICATION_CHANNEL_SERVER_COMMUNICATIONS_ID = "notification-channel-server-communications";
4242
public static final String OLD_NOTIFICATION_CHANNEL_PUSH_NOTIFICATIONS_ID = "notification-channel-push-notifications";
43-
public static final String NEW_HIGH_PRIORITY_NOTIFICATION_CHANNEL_PUSH_NOTIFICATIONS_ID = "notification-channel-high-priority-push-notifications";
43+
public static final String NOTIFICATION_CHANNEL_GENERAL_PUSH_NOTIFICATIONS_ID = "notification-channel-general-push-notifications";
4444
public static final String NOTIFICATION_CHANNEL_MESSAGING_ID = "notification-channel-messaging";
4545

4646
/**
@@ -193,7 +193,7 @@ public void createNotificationChannels() {
193193
NotificationManager.IMPORTANCE_LOW);
194194

195195
deleteIfOldPushNotificationExists();
196-
createNotificationChannel(NEW_HIGH_PRIORITY_NOTIFICATION_CHANNEL_PUSH_NOTIFICATIONS_ID,
196+
createNotificationChannel(NOTIFICATION_CHANNEL_GENERAL_PUSH_NOTIFICATIONS_ID,
197197
R.string.notification_channel_push_notfications_title,
198198
R.string.notification_channel_push_notfications_description,
199199
NotificationManager.IMPORTANCE_HIGH);

app/src/org/commcare/pn/workermanager/NotificationsSyncWorkerManager.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ class NotificationsSyncWorkerManager(
125125

126126
/**
127127
* This can receive the push notification data payload from FCM and notification API.
128+
* @param context - android context
129+
* @param showNotification - decide whether to show a notification or not after sync is successful.
130+
* @param syncNotification - decide to pull / sync any pending notifications or not.
128131
*/
129132
constructor(
130133
context: Context,
@@ -193,7 +196,7 @@ class NotificationsSyncWorkerManager(
193196
fun startSyncWorkers(notificationsPayload: ArrayList<Map<String, String>>?) {
194197
notificationsPayload?.let {
195198
for (notificationPayload in notificationsPayload) {
196-
parseAndStartNotificationWorker(notificationPayload) // syncNotification is false always as this method will check for sync
199+
parseAndStartNotificationWorker(notificationPayload)
197200
}
198201
}
199202
syncNotificationIfRequired()

app/src/org/commcare/services/FCMMessageData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public FCMMessageData(Map<String, String> payloadData) {
6060
notificationText = payloadData.get(NOTIFICATION_BODY);
6161
action = payloadData.get(REDIRECT_ACTION);
6262
priority = NotificationCompat.PRIORITY_MAX;
63-
notificationChannel = CommCareNoficationManager.NEW_HIGH_PRIORITY_NOTIFICATION_CHANNEL_PUSH_NOTIFICATIONS_ID;
63+
notificationChannel = CommCareNoficationManager.NOTIFICATION_CHANNEL_GENERAL_PUSH_NOTIFICATIONS_ID;
6464
smallIcon = R.drawable.commcare_actionbar_logo;
6565
}
6666

0 commit comments

Comments
 (0)