Change the icon of the push notification status bar on Android and IOS

Daniel Faria picture Daniel Faria · Apr 27, 2015 · Viewed 14.4k times · Source

My app icon is blue/red and when I receive a push notification the icon on status bar is the same app icon(blue/red). I want the icon of the status bar be a transparent and white version.

My ionic project is using this cordova plugin to receive push notifications. The official docs of the plugin theres nothing about how to configure the icon of the status bar notification.

Answer

Leo Nikkilä picture Leo Nikkilä · May 4, 2015

Looks like what you’d want isn’t possible with that library.

On iOS

According to the documentation, the notification icon is automatically set to your app’s small icon (Icon-Small.png):

In the banner, iOS displays your notification message and the small version of your app icon.

Unless you change the small version of the app icon, this is not possible at all on iOS.

On Android

Using the Android APIs this would be simple with Notification.Builder#setSmallIcon(int), but the library you’re using hard-codes that icon to the application’s icon.

You’d need to modify the library to accept other icons. It’s likely that this has not been implemented so that the behaviour would be consistent on all platforms.

UPDATE

Now with this plugin is completely possible.