Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not displaying badge on Xiaomi devices #440

Open
adam-musiol opened this issue Jul 24, 2023 · 8 comments
Open

Not displaying badge on Xiaomi devices #440

adam-musiol opened this issue Jul 24, 2023 · 8 comments
Assignees
Labels
Android Android only issue Configuration Issue Configuration Issue

Comments

@adam-musiol
Copy link

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 adam-musiol added the bug Something isn't working label Jul 24, 2023
@thudugala thudugala added the Android Android only issue label Jul 24, 2023
@thudugala
Copy link
Owner

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

@thudugala thudugala added Configuration Issue Configuration Issue and removed bug Something isn't working labels Jul 24, 2023
@adam-musiol
Copy link
Author

@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
Copy link
Owner

@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
Copy link
Author

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
Copy link
Author

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 adam-musiol reopened this Jul 25, 2023
@thudugala
Copy link
Owner

@adam-musiol
Copy link
Author

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android only issue Configuration Issue Configuration Issue
Projects
None yet
Development

No branches or pull requests

3 participants