Copy link to clipboard
Copied
Hi,
It seems I still cannot set the correct notifications for Andorid in Adobe Air SDK 21.0.0.215
From my understanding in order for this to work we need to supply certain icon sizes as entirely white.
Source from here: Customizing Notifications ยท OneSignal Push Notification Service Documentation
Starting with Android 5, the OS forces the notification icon to be all white when your app targets Android API 21+. If you don't make a correct small icon, it will most likely be displayed as a solid white square or circle in the status bar.
Android 3.0 and higher
These icons are expected to be entirely white.
res/drawable-mdpi-v11/ic_stat_onesignal_default.png
24x24 pixelsres/drawable-hdpi-v11/ic_stat_onesignal_default.png
36x36 pixelsres/drawable-xhdpi-v11/ic_stat_onesignal_default.png
48x48 pixelsres/drawable-xxhdpi-v11/ic_stat_onesignal_default.png
72x72 pixels
In my app_name-app.xml file I can set 36x36, 48x48, 72x72 fine. But as soon as I supply 24x24 it get the follwing error:
Unexpected or unknown element in the application descriptor file.
application.icon.image24x24 is an unexpected element/attribute
When I set the 36x36, 48x48, 72x72 as entirely white icons and test a notification my icon still appears wrong so this makes me feel the 24x24 size is the missing key here (Tested on devices Samsung S7 and S5).
Can we get this fixed so we can supply that size when we package? Or forgive me if I have missed the obvious here.
I hope someone can help. We are now on Android 6+
Related post: Android: Add alternative Icon for notifications
Related feature request: Feature#4060095 - Add custom resources on Android
Thanks
Copy link to clipboard
Copied
Does anyone have any input on this at all?
Copy link to clipboard
Copied
The native extension that you are using chooses what icons will be displayed. Because you can't specify custom Android resources outside of the extension, it is common to simply retrieve the app's icon on the Android side (not sure which size is returned by default). The smaller icons you specify in your descriptor are never considered for use.
If you have source code for the extension, you could add your icons as resources for the Android side and modify the sources so that the corresponding icons are used for the notification.
If you don't have sources, you could try contacting the developer and ask him to repackage the extension with your icons.
Copy link to clipboard
Copied
Thanks for the info mar.pies I understand a bit more now.
I will contact the developers and see what they say. I think having a custom extension with icons for each one would be a real pain to maintain as I have a few apps.
Do you think Adobe Air will ever allow us to specify our own resources folder and package up?
Copy link to clipboard
Copied
Yes, unfortunately, it's quite inconvenient at the moment. That's why michaelarchbold posted the request #4060095, to let the developers customize the notification icons without having to dig into the extension sources.
There has been no response from Adobe staff so unless there is a sudden interest in the feature it's unlikely it will appear anytime soon.
Copy link to clipboard
Copied
Cool thanks for clearing things up
Copy link to clipboard
Copied
If you need a hand adding custom resources I can create an ANE for you that will package the icons correctly. You just need to create your icons using the Android asset studio:
Make sure the name used there matches the resource name one signal needs (ic_stat_onesignal_default)
Then send me the zip (airnativeextensions@distriqt.com) and I'll put together an ANE that you'll just need to package with your app.
I'm in process of putting documentation together to show you how to do this yourself but in the meantime happy to knock it up for you.
Cheers
Copy link to clipboard
Copied
Wow thanks Michaeal, I will get in touch.
Cheers