dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.82k stars 1.66k forks source link

Unable to set alternate app icons in maui Android!! #22703

Open lakhan-bairawat opened 1 month ago

lakhan-bairawat commented 1 month ago

Description

Previously, in Xamarin.Forms, we can set alternate app icons by registering multiple icons in the Android manifest and iOS Info.plist files. This allowed us to change the app icon and app name based on an identifier.

However, in .NET MAUI 7, achieving the same functionality but it's not supported in .net 8 android . In .NET 7 MAUI:

For Android: You can still use the previous method of registering multiple icons in the Android manifest file. This allows you to change the app icon based on an identifier.

For iOS: Use the CFBundleAlternateIcons key in the Info.plist file to define alternate app icons. Then, you can use the UIApplication.SharedApplication.SetAlternateIconName method to change the app icon dynamically.

In .NET 8 MAUI:

For Android: Since Android does not support adding alternative icons,

For iOS: You can still use the CFBundleAlternateIcons key in the Info.plist file and the UIApplication.SharedApplication.SetAlternateIconName method to define and change alternate app icons as needed.

Please offer an alternative method to achieve this.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

8.0.20 SR4

Affected platforms

Android

Affected platform versions

Android All Versions

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mattleibow commented 1 month ago

Are you able to elaborate on "Android does not support adding alternative icons"?

Did a version of Android lose the ability to have multiple icons? Are multiple icons not being generated?

Can you provide a sample where you expect the icons to work, but it does not?

lakhan-bairawat commented 3 weeks ago

please check the code for this issue on below git repo. https://github.com/lakhan-bairawat/MauiBuugs

lakhan-bairawat commented 3 weeks ago

Are you able to elaborate on "Android does not support adding alternative icons"?

.net 7 i can change the app icon and name on runtime but not support in .net 8

Did a version of Android lose the ability to have multiple icons? Are multiple icons not being generated?

i have multiple icon and i want to set icon based on id

Can you provide a sample where you expect the icons to work, but it does not?

please check the code for this issue on below git repo. https://github.com/lakhan-bairawat/MauiBuugs

lakhan-bairawat commented 1 week ago

please share the solution for this issue

RoiChen001 commented 5 days ago

I can repro this issue at Android platform on the latest 17.11.0 Preview 2.1(8.0.60&8.0.40).