Support for images in notifications?
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, 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
Yes this would be even better with the builder, great idea!
+1 for this
@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 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.
This takes more than I expected so for now, I moved it into next milestone
Sure, no worries. Thank you!
Hello! Our team are looking forward to this feature too. Could you please estimate, when you will be able to do it?
Hello, we are waiting for this feature as well, when 1.4.0 incoming? Thanks
I think this is a very important feature because then we can customise it according to the brand guidelines.
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:
-
NotificationImage.Url("image url here")(make sure you also add internet permission, because it will need to download image from url) -
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")
}
Thank you @mirzemehdi for making it happen!
Can we support drawable resource for notification?