KMPNotifier icon indicating copy to clipboard operation
KMPNotifier copied to clipboard

Support for images in notifications?

Open Tweener opened this issue 1 year ago • 7 comments

Hi,

First of all, great work for your libraries man! Love what you do and it's very useful 💪

I've integrated successfully this library in one of my project. Everything works nicely. I was wondering if you plan to add the image feature in notifications? (For instance, this documentation for Android).

Cheers!

Tweener avatar Aug 15 '24 13:08 Tweener

@Tweener, yes this is good point. I'll add this to next milestone. Also for next step will think about maybe passing whole notification builder for more advanced customization if possible

mirzemehdi avatar Aug 15 '24 15:08 mirzemehdi

Yes this would be even better with the builder, great idea!

Tweener avatar Aug 16 '24 07:08 Tweener

+1 for this

Shabinder avatar Aug 29 '24 11:08 Shabinder

@mirzemehdi Thank you for the this great lib. Also, it would be great if you add this enhancement sooner !!!

Also, one question, is this issue open for contribution?

Khudoyshukur avatar Aug 30 '24 06:08 Khudoyshukur

@Khudoyshukur yes, it is open for contribution. I couldn't find some time to implement this, but this is definitely in my mind. WIll try to add this in 2 weeks.

mirzemehdi avatar Sep 09 '24 13:09 mirzemehdi

This takes more than I expected so for now, I moved it into next milestone

mirzemehdi avatar Sep 30 '24 13:09 mirzemehdi

Sure, no worries. Thank you!

Tweener avatar Oct 01 '24 06:10 Tweener

Hello! Our team are looking forward to this feature too. Could you please estimate, when you will be able to do it?

Too-Many-Bytes avatar Dec 03 '24 07:12 Too-Many-Bytes

Hello, we are waiting for this feature as well, when 1.4.0 incoming? Thanks

not2exe avatar Dec 04 '24 18:12 not2exe

I think this is a very important feature because then we can customise it according to the brand guidelines.

ubarua123 avatar Dec 07 '24 06:12 ubarua123

Thank you guys waiting this long, and @Tweener thank you for opening this issue. Now, finally sending images are supported both in android and ios in 1.4.0 version🎉🥳 @ubarua123 @Shabinder @Khudoyshukur @Too-Many-Bytes @not2exe

in image field you can either pass:

  1. NotificationImage.Url("image url here") (make sure you also add internet permission, because it will need to download image from url)
  2. NotificationImage.File("image file path") (make sure your app has necessry permission to access that image file path to be able to read its contents)

Example code:

val notifier = NotifierManager.getLocalNotifier()
notifier.notify {
  id= Random.nextInt(0, Int.MAX_VALUE)
  title = "Title from KMPNotifier"
  body = "Body message from KMPNotifier"
  payloadData = mapOf(
    Notifier.KEY_URL to "https://github.com/mirzemehdi/KMPNotifier/",
    "extraKey" to "randomValue"
  )
  image = NotificationImage.Url("https://github.com/user-attachments/assets/a0f38159-b31d-4a47-97a7-cc230e15d30b")
}

mirzemehdi avatar Dec 11 '24 23:12 mirzemehdi

Thank you @mirzemehdi for making it happen!

Tweener avatar Dec 12 '24 08:12 Tweener

Can we support drawable resource for notification?

Pranathi-pellakuru avatar May 18 '25 14:05 Pranathi-pellakuru