Xamarin local notifications set to low importance still risk audible alerts on some devices
0 reputation · 17 Jan 2020, 18:39 UTC
0 reputation · 17 Jan 2020, 18:39 UTC
I want a Xamarin app (Android and iOS) to post local notifications that appear silently in the shade or Notification Center, with no sound, vibration, banner, or badge. The design intent is a low-priority status update that the user can check at their convenience.
On Android, the plan is a NotificationChannel with importance set to Low or Min. On iOS, the plan is delivery with UNNotificationPresentationOption.None so the alert lands only in Notification Center. Both platforms require notification permission first (POST_NOTIFICATIONS on Android 13+, alert authorization on iOS).
The unresolved concern is reliability across devices. Research suggests some Android OEM skins (for example MIUI or EMUI) can override channel importance, and on iOS the outcome may depend on which authorization options were originally requested and how the user has configured Settings → Notifications for the app. Emulator testing may not reflect real device behavior.
To achieve truly silent notifications that reside only in the notification shade or center, you must combine channel importance with explicit attribute suppression on Android and delegate-level presentation options on iOS.
While ImportanceLow or ImportanceMin generally suppresses sound and banners, some OEM skins (such as MIUI or EMUI) may apply their own defaults. To maximize reliability, you should explicitly disable sound and vibration on the NotificationChannel object during creation.
Implementation Strategy:
Importance to ImportanceLow (no sound, no pop-up) or ImportanceMin (no sound, no status bar icon).SetSound(null, null) and SetVibrate(false).Requesting alert authorization at launch does not make silent delivery impossible. Authorization grants the capability to show alerts, but the UNUserNotificationCenterDelegate determines how a specific notification is presented when the app is in the foreground.
Implementation Strategy:
WillPresentNotification method in your UNUserNotificationCenterDelegate.UNNotificationPresentationOption.None to ensure the notification lands in the Notification Center without triggering a banner, sound, or badge while the app is active.sound and alert keys; omitting these or setting them to null ensures a silent arrival.Emulators often use a "clean" version of the OS that adheres strictly to API specifications. To verify behavior on physical devices:
Settings > Apps > [Your App] > Notifications. Check the specific channel to see if the OS has assigned it a "Silent" or "Low" priority. Test on at least one Pixel (Stock) and one Samsung or Xiaomi device to check for OEM overrides.UNNotificationPresentationOption.None logic triggers when the app is open, and that system-level settings in Settings > Notifications are not overriding your intent.Missing Diagnostic Detail: Are you using a third-party push notification wrapper (like Firebase or Azure Notification Hubs) for these local notifications, or are you using the native NotificationCompat and UNUserNotificationCenter APIs directly? Wrappers can sometimes inject default sound payloads that override local settings.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.