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
[expo-notifications] Mixed notification icons on Android after udpate to SDK v39 #10469
[expo-notifications] Mixed notification icons on Android after udpate to SDK v39 #10469
Comments
We just moved from legacy notifications to this. In legacy notifications we never had (4) set (as I remeber), as we are not setting explicitly the large icon. The small icon was correctly set before to what is now the large icon. Just moving to new API, without any other configuration, is producing the output as show above in issue description. I am not sure if this is due to the not setting the icon explicitly in the This is from the built app. Same behavior is in the expo-client as well. Setting the color or icon in the notifications part of the |
Hi, I'm having similar issue in standalone build in android. Notification coloring and the big icon on the right are inconsistent. The difference in my case is that I have notification.icon and notification.color configured in the app.json. I described it in more detail here: https://forums.expo.io/t/sdk-39-inconsistent-notification-ui-in-android-standalone-build/43295 |
@viljark Can you share your |
Ohh so it's more complicated than I thought :/ In #10471, I've added a way to remove the large icon. If you provide the Moreover, in my case, the small icon was always set to the app's icon (it's expected behavior).
Unfortunately, I don't have |
@ivansenic I'm waiting for standalone build to finish so I can show the screenshots. |
@ivansenic, I assumed that you have the When you don't provide the custom one, the |
@lukmccall We do have primary color set to |
@lukmccall so here are the results when custom notification color and notification icon are provided. Remote and local notifications in Expo client: Remote and local notifications in standalone Android bundle: So my 2 issues are:
|
@viljark Thanks so much for the effort here and the example project. I think I managed to figure out what's going on based on the settings in the
Do you see this as correct? |
@ivansenic, the original icon color is blue 🤷🏼♂️ So I assumed it was changed correctly.
It was fixed by 710776d |
|
I'm also trying to fix the issue with the small Android icon showing the Expo icon. I don't have notification.icon and notification.color set. I'm worried about screwing up iOS notification icon which is working fine. I also noticed that we cannot put "notification" keys under "ios" or "android" in app.json. What is the recommended way of solving the small Expo icon on Android without having to set "notification.color" which might be different between iOS and Android? |
@Aryk, I think that To change the icon on iOS, you need to change the app icon and it's the only way to achieve this. |
) # Why Fixes #10469. # How The `largeIcon` isn't set correctly. Moreover, for now, we don't have enough tools to config it properly. So we temporarily remove it. This functionality will be reimplemented in the future. # Test Plan - NCL ✅
Desired behavior:
The large icon was removed in the managed workflow. However, you can use it in the bare workflow. For more information, check https://github.com/expo/expo/blob/master/packages/expo-notifications/README.md#configure-for-android.
|
Unfortunately, I'm not sure if those fixes will help in all cases. So I reopen this issue. After the SDK |
) # Why Fixes #10469. # How The `largeIcon` isn't set correctly. Moreover, for now, we don't have enough tools to config it properly. So we temporarily remove it. This functionality will be reimplemented in the future. # Test Plan - NCL ✅ # Conflicts: # packages/expo-notifications/CHANGELOG.md
) # Why Fixes #10469. # How The `largeIcon` isn't set correctly. Moreover, for now, we don't have enough tools to config it properly. So we temporarily remove it. This functionality will be reimplemented in the future. # Test Plan - NCL ✅ # Conflicts: # packages/expo-notifications/CHANGELOG.md
Can someone from the Expo team clarify this...could we also maybe add to the docs that the notification.icon and notification.color are android only even though they are not under the "android" part of the app.json? https://docs.expo.io/versions/latest/config/app/#notification @brentvatne can you confirm this? |
as far as i know this is correct, cc @cruzach |
fixes for this have been deployed. more info at #10464 (comment) |
@brentvatne @lukmccall Followed the instructions, updated the app and build the new version (Android). The problem still persists on OnePlus 6 with Android 10. The small icon is still Expo's one, while the big icon is gone now. We have no @viljark I guess your problem is resolved or? |
@ivansenic yes, my problem is partially solved since I use notifications.icon, but the notifications.color is still not applied correctly to locally triggered notifications. |
Is it not possible to just show the default app icon for local or push notifications mentioned in |
According to Android, as of Android 5 you should:
so no, it is not recommended that you use your app icon as the notification icon. If you do, then there's a good chance the OS will simply render a blank square or circle (see @diegoserranor 's image above). It does look like there may have been a regression here, but for anyone needing a fix right now- I've confirmed that setting the Some things that do need to be addressed by us:
Edit- on second thought, I think it might be a good idea for us to default to a greyscale of your app icon by default |
@cruzach on sdk38 my colored app icon was showing fine in notifications, local and push notifications, its not about going against the recommendations, I'll definitely add those too, but whatever the case is standalone should never set the default notification icon to expo app icon, thats whats happening for me on sdk39, a sensible fallback would still be app's icon. |
yeah i agree, I haven't figured out what's caused that behavior of falling back to the expo icon yet, that's definitely not what we want to be doing. |
Thank you for clarifying @cruzach. A greyscale with alpha did the trick. |
Same here, since upgrading to expo 39 the notification icon is no longer the same as the app icon, but it is now using the expo icon instead, this is causing issues with my clients. |
@dariocostanzo I shared a solution for now:
|
Yes, but I used to have the colorful app icon before, which came automatically without changing anything in the app.json (didn't have notification.icon) . Do you know how can I set it back to use the app icon? The client doesn't want a grayscale image unfortunately. Thanks |
I can't really recommend a way to do that, as I said above
|
I understand that it is not recommended, but at least the option to set the app icon or whatever works should be left up to the developer, also it was working perfectly fine before. |
Going to lock this thread so it's obvious for people coming here what the issues are & how to work around them: The bug with There is also an issue that your notification icon no longer defaults to your app icon, but this can be worked around by setting the |
This will be fixed in the next SDK release (SDK 40), but for now you can use the workarounds I stated above to set the proper notification icon |
🐛 Bug Report
Summary of Issue
After updating to SDK v39 and using the next notifications API the Android notifications icons are not mixed in the way that status bar icon is the Expo icon and notification media image (or what ever the name is) is our app icon. The example shown below is the app screenshot from OnePlus 6 running Anroid 10. I don't have the information if the behavior is some on other Android phones (@Lorezz mentioned in #9062 that this issue is only on some Android OS versions).
Environment - output of
expo diagnostics
& the platform(s) you're targetingOur
app.json
config related to notifications is empty, while the android part looks like:Expo diagnostics:
Reproducible Demo
I don't have the reproducible demo, as you need to build the app to expect the correct notifications icon.
Steps to Reproduce
Expected Behavior vs Actual Behavior
Both icons should be set correctly.
The text was updated successfully, but these errors were encountered: