I increased notifications in my app through the OneSignal plugin, I would like to customize the icon and sound of the notification, I followed the documentation, but it did not work.
What could I have done wrong? Here is a print of my config.xml
The code config.xml:
<platform name="android">
<allow-intent href="market:*" />
<resource-file src="resources/android/sound/open-ended.mp3" target="platforms/android/res/raw/open-ended.mp3" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
</platform>
the app.component.ts:
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.handleNotificationReceived().subscribe(data => {
data.payload.sound = 'open-ended',
data.payload.smallIcon = 'drawable-hdpi-icon'
});
this.oneSignal.handleNotificationOpened().subscribe(() => {
// do something when a notification is opened
});
this.oneSignal.endInit();
I'm using cordova-android:7.1.4, and onesignal-cordova-plugin:2.4.5