Does an Android notification channel created by expo-notifications persist after an app reinstall or OS upgrade?
0 reputation · 27 Feb 2024, 22:30 UTC
0 reputation · 27 Feb 2024, 22:30 UTC
I'm designing the alert strategy for an Expo app (SDK 50+, tested in a development build since Expo Go no longer supports push) and want to split notifications into Android channels via setNotificationChannelAsync — e.g., a HIGH-importance "messages" channel and a LOW-importance "promotions" channel — with iOS interruptionLevel handling the equivalent on Apple devices.
The documented behavior is that Android channels are effectively immutable once created: importance, sound, and vibration can't be changed programmatically afterward, so fixing a noisy channel means shipping a new channel ID and migrating users to it. What I can't determine from the docs alone is the lifecycle of the old channel.
Specifically:
I'd rather verify this against documented behavior than discover it after shipping a migration to new channel IDs.
30775 reputation · 28 Feb 2024, 05:34 UTC
No to the first, yes to the second, and no to the third — with one important caveat on each.
Because a reinstall wipes channels, your migration to new channel IDs is actually simpler than it looks: new installs and reinstalls get the new IDs immediately. The only cohort that matters is existing users who upgrade the app in place — they keep the old channel (with any user-modified importance) until you ship the new ID and they get a build that creates it.
Calling setNotificationChannelAsync on every launch is safe and idempotent: Android ignores updates to an existing channel's importance, sound, and vibration, so re-asserting creation costs nothing and guarantees the channel exists after edge cases like data clears. It will not, however, undo a user's manual downgrade — that immutability is by design.
You can read the current state of a channel at runtime. On the native side this is NotificationManager.getNotificationChannel(id).getImportance(); in Expo you can inspect channels via getNotificationChannelsAsync() (Android only, SDK 51+ — verify against your SDK version's API reference, as this surface has changed between releases). A pragmatic pattern:
Linking.openSettings() / the channel settings intent rather than silently continuing to send.These behaviors are well-established Android platform semantics, but confirm them on your target devices and Expo SDK version:
adb shell dumpsys notification | grep -A 10 your.package.nameRun this before and after an uninstall/reinstall (channels should be gone, then recreated only by your code), and after an OS update with the app installed (channels and importance should be intact). Also test the upgrade-in-place path from your current production build to the build with new channel IDs, confirming both old and new channels coexist and the old one stops receiving traffic.
One open detail worth checking on your side: if your backend keys notification routing by channel ID, confirm how it handles devices that haven't yet upgraded to the build containing the new IDs — that's the gap most channel migrations actually break on.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.