katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.56k stars 1.75k forks source link

SmallIcon don't work #1681

Open veronesecoms opened 5 years ago

veronesecoms commented 5 years ago

WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.

Your Environment

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)

cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"

Expected Behavior

I put the icon in MyApplication/resources/iconnotificacao.png and do in my code:

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,

but the small icon don't work.

What were you trying to do?

setting a small icon in local notification

rwillett commented 5 years ago

There is numerous help in the issues list on small icons. Suggest you read them and follow the instructions.

djpero commented 5 years ago

@veronesecoms

  1. Goto /platforms/android/app/src/main/res/mipmap-hdpi
  2. add icon 48x48 and name it n_icon.png (white version with transparency)
  3. add smallIcon: 'res://n_icon.png'
sarvap-praharanayuthan commented 5 years ago

@veronesecoms

  1. Goto /platforms/android/app/src/main/res/mipmap-hdpi
  2. add icon 48x48 and name it n_icon.png (white version with transparency)
  3. add smallIcon: 'res://n_icon.png'

@djpero Well thanks for this, placing the image 48 x 48 in /platforms/android/app/src/main/res/mipmap-hdpi worked for me but with smallIcon: 'n_icon'.

What does not worked?

smallIcon: 'res://n_icon.png' or smallIcon: 'res://n_icon' or smallIcon: 'n_icon.png' does not worked.

Checked in Android Pie, Oreo and Marshmallow devices.

J4si3k commented 5 years ago

any other ideas? it does not work for me. Property "smallIcon" must be of kind res://...

I use this plugin with meteor, icon property works, but smallIcon not. i'm trying multipley syntax like @sarvap-praharanayuthan

edit This works for me #1627