Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/android/CustomFCMReceiverPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ public boolean onMessageReceived(RemoteMessage remoteMessage) {
Log.d("CustomFCMReceiver", "onMessageReceived");
boolean isHandled = false;

int originalPriority = remoteMessage.getOriginalPriority();
int currentPriority = remoteMessage.getPriority(); // PRIORITY_HIGH = 1, PRIORITY_NORMAL = 2, PRIORITY_UNKNOWN = 0

if (originalPriority != currentPriority) {
Log.e(TAG, "onMessageReceived: MESSAGE DEPRIORITIZED! originalPriority: " + originalPriority + " currentPriority: " + currentPriority);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this collected somewhere that we can see?

how would this help us identifying problems unless the phone is being watched by a dev?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could additionally try to report errors/logs to Google play or appsignal or something.

This is still somewhat useful as we (devs) could attempt to run through reproduction steps, and use this to see what is happening to the message priority. Or if its someone like Sara or QA, we could (possibly) provide instructions on how to check logs.

Will try to think of something for that and propose something

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a general / existing problem with viewing android Logs against other people's including customers, QA, etc. devices.

I'll try to think of what we should do for that

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i use https://docs.appsignal.com/api/public-endpoint/errors.html in google-calendar add-on to collect data (created a separate appsignal "environment" for this purpose)

maybe it's an option for you too.

Copy link
Copy Markdown
Member Author

@WesUnwin WesUnwin Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into this (sorry for the delay)...

// Note: apps running in the background have restrictions imposed on them:
// See doc: https://developer.android.com/develop/background-work/services/fgs/restrictions-bg-start
// When the message is deprioritized like this, this may result in issues later related to notifications, foreground services, etc.
}

try {
Map<String, String> data = remoteMessage.getData();
isHandled = inspectAndHandleMessageData(data);
Expand Down