Cancel may have messages notification from FcmJobService.

This commit is contained in:
Cody Henthorne
2025-08-04 12:57:20 -04:00
parent 26df14124b
commit 6379f9f453
2 changed files with 3 additions and 1 deletions

View File

@@ -98,7 +98,8 @@ object FcmFetchManager {
.notify(NotificationIds.MAY_HAVE_MESSAGES_NOTIFICATION_ID, mayHaveMessagesNotification)
}
private fun cancelMayHaveMessagesNotification(context: Context) {
@JvmStatic
fun cancelMayHaveMessagesNotification(context: Context) {
NotificationManagerCompat.from(context).cancel(NotificationIds.MAY_HAVE_MESSAGES_NOTIFICATION_ID)
}

View File

@@ -50,6 +50,7 @@ public class FcmJobService extends JobService {
if (success) {
Log.i(TAG, "Successfully retrieved messages.");
FcmFetchManager.cancelMayHaveMessagesNotification(this);
jobFinished(params, false);
} else {
Log.w(TAG, "Failed to retrieve messages. Scheduling a retry.");