cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

SmallIcon don't work

Open veronesecoms opened this issue 6 years ago • 5 comments

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

veronesecoms avatar Sep 17 '18 15:09 veronesecoms

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

rwillett avatar Sep 25 '18 06:09 rwillett

@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 avatar Nov 10 '18 23:11 djpero

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

sarvap-praharanayuthan avatar Jan 29 '19 18:01 sarvap-praharanayuthan

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

J4si3k avatar May 15 '19 19:05 J4si3k

Thanks, @djpero , works!!

Walt2018 avatar Nov 28 '20 02:11 Walt2018