Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change Small Icon of OneSignal Notifications in a Cordova Android App?

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.

like image 932
Divyansh Pratap Singh Avatar asked Jan 05 '23 03:01

Divyansh Pratap Singh


2 Answers

Create a transparent image and name it as ic_stat_onesignal_default, and call it where it requires. It will work.

like image 50
Yokesh Avatar answered Feb 06 '23 09:02

Yokesh


@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.

like image 35
jkasten Avatar answered Feb 06 '23 09:02

jkasten