bug(YouTube - Custom branding): Push notifications do not show branding icon
Bug description
"Custom Branding" patch is applied and the in-app setting to change the icon is set to "ReVanced". The app launcher icon now shows ReVanced, but push notifications still show the original YouTube icon.
Â
Solution
If your launcher allows custom icons, then download the ReVanced icon from here and set your launcher to use this icon. Push notification will then show the custom icons and not stock YouTube.
Â
Acknowledgements
- [x] I have checked all open and closed bug reports and this is not a duplicate.
- [x] I have chosen an appropriate title.
- [x] All requested information has been provided properly.
The notification icon should change too, but it doesn't because the manifest entry for the notification wasn't changed.
Will have to make some adjustments for the notification to show the branding icon.
The original app icon is still declared in the <application> manifest entry, and this application icon cannot be dynamically changed using an in-app setting.
Normally this is not a problem for the launcher because it uses the new aliases with whatever icon the user picks in the app settings, but this application icon can appear in a few other places such as:
- Other apps that show the app icon. Most notable is the microG push notification app registration list.
- Push notification on devices that do not follow Android ASOP design (such as Samsung, which is shown in the screenshot in the first post).
To change the icon in the places above, the only way is to permanently change the app icon during patching.
I found where the android status bar icons is set (black and white icon that appears in the same area as the system clock/battery/etc), and verified that icon can be changed.
I found what I think is where the YT logo notification icon is set (red/white large icon in the notification), but gotta wait until some more push notifications come in to verify if it's fixed.
Making this change is difficult because it's so slow to try changes.
The push notification is using the icon defined in the application manifest, which cannot be dynamically changed.
I am unsure if Android is showing the push notification using the manifest application icon, or if YT is adding the icon to the notification content body. If Android is showing it based on the manifest then the push notification icon cannot be dynamically changed.
But now I'm questioning, should the push notification icon be changed at all? If it's changed to the ReVanced icon then both YouTube and YouTube Music will show the same icon for push notifications, and the push content is specific to YouTube and not ReVanced specific.
I guess if it can be programmatically changed, then an additional ReVanced UI setting could be added to control the behavior. But right now I'm unsure if that is possible at all.
Is it still possible to set a fixed icon during patching like before? I don't necessarily need a dynamic icon that I can change in the settings, but it is a bit confusing to have a different icon on the notifications than on my home screen.
I'll look more and see if the push notification can be changed programmatically.
The SB sent segment popup also does not have branding icon. Try send SB segment to test.
SB sent can show a simple custom toast like the undo skip popup, where no icon is shown.
Toast app icon is shown by some vendors and it cannot be customized if the system toast is used.
I've found the push notification code, and there's two icons. 'small icon', and 'large icon". Both can be changed using a patch.
https://developer.android.com/develop/ui/views/notifications/expanded
The small icon is the tiny monochrome icon that appears in the system status bar with the clock/battery/etc. This icon is displayed the same way for all devices manufacturers. We can dynamically replace that with a tiny monochrome ReVanced icon that matches the current icon style, but I'm not sure if we want to.
The large icon appears in the push notification, and if the notification is the large style like YouTube uses, the large icon is only visible when the notification is collapsed and not expanded. That can be dynamically set to whatever icon style is currently set.
But...many manufacturers, including Samsung, also always show the push notification along with the application icon (see screenshot in first post, it's the YT icon on the left side). This icon cannot be programmatically changed and it's always whatever icon is hard coded to the application manifest. The Reddit app when using a premium icon has this same behavior and push notifications always show the original reddit default icon no matter what premium icon is active.
So, for devices like Samsung, the only way to change the push notification icon is to add a patch option that permanently changes the app icon to a specific style. If this permanent patch option is used, I don't think the in-app icon settings should be exposed because then the push notification icon may not match the current in-app custom icon setting.
I wish there was a work around to avoid this because I really dislike permanently changing the icon.
https://github.com/ReVanced/revanced-patches/pull/6108 will fix the issue for most devices, such as Google Pixel devices.
For Samsung and any other device that adds the application manifest icon, the only fix is to allow permanently changing the icon (will do that in another PR).
Mine's also having this issue after I updated fresh. Also in my device's App Info and ReVanced Manager's App Info. It used to just make them all the Revanced icon after using the Custom Branding patch, but not anymore.
How did you get the video thumbnail in the notification, though? I used to have it with the old YT version, but since updating, it now just shows the YouTube icon again instead.
@S-Mania read the solution in the first post. Please read before you post because everything is explained here.