Skip to content

Commit 82e6de8

Browse files
authored
Update README.md
1 parent 7dc5c7f commit 82e6de8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,21 @@ If you are using mac make sure you also allow notifications for browser from sys
235235
You can send either local or push notification.
236236

237237
### Local Notification
238-
Local notifications are supported on Android, iOS, JS and wasm targets.
238+
Local notifications are supported on Android, iOS, JS and wasm targets. Image is supported on Android and iOS
239239
#### Send notification
240240

241241
```kotlin
242242
val notifier = NotifierManager.getLocalNotifier()
243-
val notificationId = notifier.notify("Title", "Body")
244-
// or you can use below to specify ID yourself
245-
notifier.notify(1, "Title", "Body")
246-
247-
243+
notifier.notify {
244+
id= Random.nextInt(0, Int.MAX_VALUE)
245+
title = "Title from KMPNotifier"
246+
body = "Body message from KMPNotifier"
247+
payloadData = mapOf(
248+
Notifier.KEY_URL to "https://github.com/mirzemehdi/KMPNotifier/",
249+
"extraKey" to "randomValue"
250+
)
251+
image = NotificationImage.Url("https://github.com/user-attachments/assets/a0f38159-b31d-4a47-97a7-cc230e15d30b")
252+
}
248253
```
249254

250255
#### Remove notification by Id or all notifications

0 commit comments

Comments
 (0)