Local notification smallIcon does not show IONIC

Asked

Viewed 153 times

1

I need to change the smallIcon of my local notification, but I already set the location in my Resources but it still doesn’t appear.

I tried something like:

this.localNotifications.schedule({
              id: i+1,
              text: 'Produto: ' + res.data.notificar.perguntas[i].produto.substring(0,20) + '...',
              title: 'Nova pergunta, conta: ' + res.data.notificar.perguntas[i].conta,
              icon: 'https://image.ibb.co/gnUHn9/Iconnotificacao.png',
              smallIcon: 'res://iconnotificacao',
              priority: 2,

My notification icon is located at:

Pastadoprojeto/Resources/iconnotificacao.png

Information on Ionic/Cordova:

Ionic:

 ionic (Ionic CLI)  : 4.1.1
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 13 other plugins)

1 answer

0

Localnotification smallicon must have the correct file layout (.jpg, or . png, etc).

Test like this:

smallIcon: 'res://iconnotificacao.png'

Replace by Your File Extension.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.