thudugala / Plugin.LocalNotification

The local notification plugin provides a way to show local notifications from .Net MAUI and Xamarin Forms apps .
MIT License
401 stars 66 forks source link

Not displaying badge on Xiaomi devices #440

Open adam-musiol opened 11 months ago

adam-musiol commented 11 months ago

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):

Sample project attached

MauiNotifications.zip

thudugala commented 11 months ago

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

adam-musiol commented 11 months ago

@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.

thudugala commented 11 months ago

@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.

adam-musiol commented 11 months ago

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

adam-musiol commented 11 months ago

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.

thudugala commented 10 months ago

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

adam-musiol commented 10 months ago

@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.

samlljiangsir commented 7 months ago

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