I created an app using Cordova and Phonegap I use OneSignal for sending Push Notification but when I send the Notification to the user it shows a small bell icon and a Large Bell icon . I already change the large one because it uses link and small one use resource so I am not able so please help me.
6 Answers
Create a transparent image and name it as ic_stat_onesignal_default, and call it where it requires. It will work.

- 61
- 2
-
1I created One where to place it with respect to config.xml – Divyansh Pratap Singh Nov 02 '16 at 18:11
@Yokesh Is correct that the icon must be named ic_stat_onesignal_default
. The location of the file however depends on the fork of Cordova you are using.
For Cordova CLI or Ionic the path is:
<project-root>/platforms/android/res/drawable-[SIZE_NAMES]/
PhoneGap Build (PGB):
<project-root>/locales/android/drawable-[SIZE_NAMES]/
Replace [SIZE_NAMES]
with hdpi
, xhdpi
, xxhdpi
, xxxhdpi
creating one for each name. Four folders will be created in total.
See OneSignal's Customize Notification Icons guide for more details.

- 3,899
- 3
- 32
- 51
-
1I named it but where do I place it in respect to config.xml – Divyansh Pratap Singh Nov 03 '16 at 06:45
-
This worked for me. The only thing that I didn't know that those images need to be white and transparent as explained here: http://stackoverflow.com/questions/39034625/onesignal-pushnotification-small-icon-not-displayed-on-android – Claudio Shigueo Watanabe Jan 18 '17 at 02:12
-
@jkasten when I tried with your solution, It is showing Grey box instead of image in notification. My icon image is colored not white. Is there anyway to create colored small icon image? – Darshana May 23 '19 at 06:15
-
1@Darshana Starting with Android 5.0 notification icons can no longer have colors. Only the alpha channel from image is used now. However an accent color can be set which it will apply to the alpha channel of the image, this means you can have only 1 color – jkasten May 24 '19 at 01:41
This link ultimately helped me: https://documentation.onesignal.com/docs/customize-notification-icons
You need to add ic_stat_onesignal_default.png in the appropriate size to each of the resource folders where icons are stored. For cordova this was:
platforms/android/res/drawable-hdpi
platforms/android/res/drawable-ldpi
platforms/android/res/drawable-mdpi
platforms/android/res/drawable-xhdpi

- 1,285
- 3
- 14
- 40
-
I created a node package to help with this process: https://www.npmjs.com/package/onesignal-push-icon – Mark Sep 27 '17 at 08:01
Here is official documentation about notification icons:
https://documentation.onesignal.com/docs/customize-notification-icons
The normal vector asset or png file in drawable is not working. Even mipmap also. You need to create custom drawable with different size configurations.
Use these directories for Native Android:
res/drawable-mdpi/ (24x24)
res/drawable-hdpi/ (36x36)
res/drawable-xhdpi/ (48x48)
res/drawable-xxhdpi/ (72x72)
res/drawable-xxxhdpi/ (96x96)
res/drawable-xxxhdpi/ (256x256) (Large Icon)
And for Cordova:
<project-root>/platforms/android/app/src/main/res/drawable-mdpi/ (24x24)
<project-root>/platforms/android/app/src/main/res/drawable-hdpi/ (36x36)
<project-root>/platforms/android/app/src/main/res/drawable-xhdpi/ (48x48)
<project-root>/platforms/android/app/src/main/res/drawable-xxhdpi/ (72x72)
<project-root>/platforms/android/app/src/main/res/drawable-xxxhdpi/ (96x96)
<project-root>/platforms/android/app/src/main/res/drawable-xxxhdpi/ (256x256) (Large Icon)
Note: use the same name file in each dir.

- 1,123
- 11
- 16
Here consider this link. Please try to search first if you dont find any useful info then consider posting a question there are already questions answered.

- 1
- 1

- 180
- 1
- 12
-
-
What mean by one signal . NotificationCompat.Builder is used to support older platforms . there's nothing like one signal . or please elaborate your question further. – Zubair Soomro Nov 03 '16 at 09:42
-
1Okay Onesignal is a online service which provide us a push notification service for Both PC and mobile app . I use it's plugin in my phonegap project . Okay successfully able to complete the whole procedure and able to send notification's but In notification there are two icon first is small icon and second is large icon in notification . I am able to change the large icon because it uses link but Small one uses resource , So I don't know where to place small one Icon's in my Project . If you Know then Please Help me. – Divyansh Pratap Singh Nov 04 '16 at 07:09
-
can you show us the code you are using ? for notification builder ? – Zubair Soomro Nov 11 '16 at 11:31
NotificationCompat.Builder notificationCompat = new NotificationCompat.Builder(this) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setSmallIcon(R.mipmap.logo).setLargeIcon(R.mipmap.logo1)

- 709
- 1
- 7
- 14