thudugala/Plugin.LocalNotification

Not displaying badge on Xiaomi devices

adam-musiol opened this issue · 8 comments

Describe the bug
On Xiaomi devices badge is not working. Local notification shows up, but badge is not showing on app icon.
On emulator local notification & badge is working fine.

To Reproduce
Steps to reproduce the behavior:

  1. Start new MAUI project
  2. Install Plugin.LocalNotification package via NUGET
  3. Setup local notification with badge
  4. See local notification on device without badge

Expected behavior
Local notification with badge

Smartphone (please complete the following information):

  • Device: Xiaomi Redmi 9A
  • OS: Android 10
  • Version MIUI 12.0.20

Sample project attached

MauiNotifications.zip

@adam-musiol This is a device-specific issue. Check your device settings.

@adam-musiol This is a device-specific issue. Check your device settings.

Other applications badge works fine. I can see Gmail badge, so device is configured correctly.

I've cheked notification settings for this example app and there was badge on icon turned off, but enabling it didn't resolve the issue.

@adam-musiol Do you have any other device to test that is only happening on Xiaomi devices?

I do not have Xiaomi phone to test this. We need help from someone else.

I've been doing more tests and it turned out that I had to enable POSTNOTIFICATIONS permission in Android Manifest and it started working.

It turned out that there's still some issues on Xiaomi. Badge only works when I'm debugging. When I launch app outside of Visual Studio, Badge is no longer working, it only shows notification. On Samsung with Android 13 Badge works fine.

@adam-musiol can you get the badge to work with https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/essentials/badge?tabs=tizen

It doesn't work for any device.
I've used https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample where what You've send is implemented.
On stock android and xiaomi it displays in debugger "Current launcher doesn't support badge counter". On Samsung with Android 13 it just throws error related to permissions.
In overall I don't think it's finished.

我也是redmi note 9 pro(android 12 api 29) 如果你说的badge是小图标的话,可能小米手机上的通知图标是根据安装App的图标生成的,如果更换图标可能必须要更换应用图标,重装,并清理手机缓存不然他还是显示的上个应用的图标