Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 731
Daniel Faria Avatar asked Apr 27 '15 13:04

Daniel Faria


1 Answers

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.

like image 94
Leo Nikkilä Avatar answered Oct 23 '22 02:10

Leo Nikkilä