Bug? App Icon and Push Notification Icon are different

aminoacid

Well-Known Member
Licensed User
Longtime User
I don't know if this is a bug or by design ....

By default the App Icon that is displayed on the Home Screen of the device when the App is installed and the one that is displayed when a Firebase Push Notification arrives are different. The App Icon on the Home Screen is the one from the ""icon-store-1024.png"" file that you place in Files/Special. But the icon that appears in the push notification is just a plain gradiented blue icon.

To get the push notification icon to be the same as the App Icon, you must copy the "icon-store-1024.png" to the B4I "Files" subfolder or the "SharedFiles" folder (if using B4X Pages) and rename it to "<B4I source filename>.png". So if your source file is named "abc.b4i" then you must rename it to "abc.png" and place this file in one of those folders and recompile the program. Only then they are they the same.

This only works for B4I programs written as B4X Pages projects. For just regular (non B4X pages) programs, this does NOT work.

Shouldn't both icons be picked up from the ""icon-store-1024.png" file? It does not make sense to have to do this separately. And shouldn't this work for both B4X pages and non-B4X pages programs? I'm trying to get this to work on a older non-B4X pages program.
 

aminoacid

Well-Known Member
Licensed User
Longtime User
I found a work-around that works for both B4X Pages Apps as well as non B4X Pages Apps. With this you can eliminate the redundancy of having to place the same Icon file in the files folder:

#PlistExtra: <key>CFBundleIcons</key>
#PlistExtra: <dict>
#PlistExtra: <key>CFBundlePrimaryIcon</key>
#PlistExtra: <dict>
#PlistExtra: <key>CFBundleIconName</key>
#PlistExtra: <string>AppIcon</string>
#PlistExtra: </dict>
#PlistExtra: </dict>
 
Top