Push Advanced - optimove-tech/Optimove-SDK-Cordova GitHub Wiki

Changing the Push Icon (only for Android)

To change the push icon, you need to follow this guide.

  1. Create an icon

    We suggest checking out the Android Asset Studio to generate the icon.

    Make sure to comply with the status bar icon guidelines so the icon renders correctly on all devices.

  2. Add the icon to your project

    Copy drawable resources to www/res folder in the project.

  3. Update config.xml file

    Specify the source and destination folders along with the icon file name in your config.xml file.

    <platform name="android">
        <resource-file src="www/res/drawable-hdpi/ic_notification.png" target="app/src/main/res/drawable-hdpi/ic_notification.png" />
        <resource-file src="www/res/drawable-mdpi/ic_notification.png" target="app/src/main/res/drawable-mdpi/ic_notification.png" />
        <resource-file src="www/res/drawable-xhdpi/ic_notification.png" target="app/src/main/res/drawable-xhdpi/ic_notification.png" />
        <resource-file src="www/res/drawable-xxhdpi/ic_notification.png" target="app/src/main/res/drawable-xxhdpi/ic_notification.png" />
        <resource-file src="www/res/drawable-xxxhdpi/ic_notification.png" target="app/src/main/res/drawable-xxxhdpi/ic_notification.png" />
    </platform>
  4. Update optimove.json file

    Add the following configuration into your optimove.json file with the corresponding icon name.

    {
        "android": {
            "pushNotificationIconName": "ic_notification"
        }
    }
  5. Verify the configuration

    Make sure that the name of the drawable resource file matches the name in the configuration.

  6. Prepare the app

    Run cordova prepare android to prepare the Android app.

⚠️ **GitHub.com Fallback** ⚠️