[OneSignal Plugin] How to set small icon for Android

[OneSignal Plugin] How to set small icon for Android

  
Forge Component
(5)
Published on 27 Apr by OutSystems R&D
5 votes
Published on 27 Apr by OutSystems R&D

Hi,

We are currently getting a default bell icon as a small icon on Android devices. We have icon as ldpi on resources but it seems it is ignored:

{  
    "resources" : "MyResources.zip",
    "icons": {
        "android": [{
            "resource": "iconAndroid-ldpi.png",
            "density": "ldpi"
        }, ...


Also as for Androids > 5 the icon should be "all white" and on previous versions it is normal icon - should we have 2 different icons and where can we set them then?

Thank you.

Mykola Tkachenko wrote:

Hi,

We are currently getting a default bell icon as a small icon on Android devices. We have icon as ldpi on resources but it seems it is ignored:

{  
    "resources" : "MyResources.zip",
    "icons": {
        "android": [{
            "resource": "iconAndroid-ldpi.png",
            "density": "ldpi"
        }, ...


Also as for Androids > 5 the icon should be "all white" and on previous versions it is normal icon - should we have 2 different icons and where can we set them then?

Thank you.

Hi Mykola,


I just tested everything and it seems to be working. This is what I've done:


1. Created a default application;

2. Added this JSON to my extensibility configurations:

{
    "icons": {
        "android": [{
            "resource": "android/mipmap-ldpi/ic_launcher.png",
            "density": "ldpi"
        },{
            "resource": "android/mipmap-mdpi/ic_launcher.png",
            "density": "mdpi"
        },{
            "resource": "android/mipmap-hdpi/ic_launcher.png",
            "density": "hdpi"
        },{
            "resource": "android/mipmap-xhdpi/ic_launcher.png",
            "density": "xhdpi"
        },{
            "resource": "android/mipmap-xxhdpi/ic_launcher.png",
            "density": "xxhdpi"
        },{
            "resource": "android/mipmap-xxxhdpi/ic_launcher.png",
            "density": "xxxhdpi"
        }]
    },
    "resource": "android.zip"
}

3. Added a android.zip to the resources with this file structure:

android.zip

|--- android

|----- mipmap-xxxhdpi

|--------- ic_launcher.png

|----- mipmap-ldpi

|--------- ic_launcher.png

| ----- .....

5. Added the Notification plugin with an action

4. In the end, generated an Android app.


Please, check if this helps you :)


Best Regards,

Bruno Grácio

Hi Bruno,

Thank you very much for reply. I'll create a separate app for testing and share here the result. 

Just to confirm the "small icon" for Android >=5 should be a different then app logo image (white with transparency). In resources you have only one image for each size that will be used as app icon, right?

Thank you.

Best regards,

Nick