Skip to content

Commit

Permalink
Merge pull request #14653 from Expensify/jules-improveNotificationDel…
Browse files Browse the repository at this point in the history
…iveryWithCategorisation

Class Android notifications as a Message to improve delivery speed
  • Loading branch information
Julesssss authored Feb 1, 2023
2 parents 79d6c13 + 071e53e commit 817cd8a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.expensify.chat.customairshipextender;

import static androidx.core.app.NotificationCompat.CATEGORY_MESSAGE;
import static androidx.core.app.NotificationCompat.PRIORITY_MAX;

import android.app.NotificationChannel;
Expand Down Expand Up @@ -82,6 +83,9 @@ protected NotificationCompat.Builder onExtendBuilder(@NonNull Context context, @
super.onExtendBuilder(context, builder, arguments);
PushMessage message = arguments.getMessage();

// Improve notification delivery by categorising as a time-critical message
builder.setCategory(CATEGORY_MESSAGE);

// Configure the notification channel or priority to ensure it shows in foreground
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
builder.setChannelId(CHANNEL_MESSAGES_ID);
Expand Down

0 comments on commit 817cd8a

Please sign in to comment.