Importance or priority for modern android phones?

I’m finding the documentation a little confusing. Starting with notification channel importance

When you are setting the channel for your notification you also have the option to set the importance for the channel per notification. Possible values for this property are high, low, max, min and default. To learn more about what each value does see the FCM docs. For devices before Android 8.0 this property can be used like priority with the same options described up above.

specifically

For devices before Android 8.0 this property can be used like priority with the same options described up above.

which seems to suggest that devices before 8.0 use importance newer phones use priority.

Then critical notifications

For Android, notifications will appear immediately in most cases. However, in some cases (such as phone being stationary or when screen has been turned off for prolonged period of time), default notifications will not ring the phone until screen is turned on.

To override that behavior, set priority: high and ttl: 0.

Shows priority but then the fcm doc link

shows importance for 8.0 and newer.

priority is ignored on later versions of android and is only used for FCM for the message delivery.

importance is only set the first time you create teh channel and is ignored everytime after

most of us just use priority for the critical format, once you set teh importance for your channel you never need to set it again.

I’m sorry I’m still confused. If

but then

On a side note, I have been using priority for years without a problem and I don’t have one now. I was re-reading through the docs and noticed that in critical the example given uses priority, however the channel example uses importance. I assume both would reflect the current format.

Are they interchangeable?

no they are different. Heres a better breakdown.

  1. You send a message from the server either via automation or service call etc…
  2. That message first goes to firebase where the priority value is first handled for critical notifications. This step and the next step are skipped if you are using persistent connection
  3. Firebase sends the message to the app after processing ttl and priority
  4. Device receives the notification and processes things and thats where the docs are correct that lower versions of android ignore it.

The critical format is important for speedy delivery of the notifications so that you always get them even if the device is sleeping (dozing). That happens before teh app processes the rest of the notification like text and image etc…

It is confusing because both firebase and google use priority for different things but the name still needs to remain teh same.

1 Like