Skip to content

Releases: mirzemehdi/KMPNotifier

v1.6.1

09 Dec 16:59

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.6.0...v1.6.1

v1.6.0

12 Aug 12:19
f8b7d2b

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.5.1...v1.6.0

v1.5.1

20 Mar 16:46

Choose a tag to compare

What's Changed

  • Binary compat validator: ignore samples, add KMP config by @zsmb13 in #130
  • Make NotifierManager.onUserNotification and NotifierManager.onNotificationClicked public on iOS API by @zsmb13 in #131
  • Migrating maven publish to new one by @mirzemehdi in #133

Full Changelog: v1.5.0...v1.5.1

v1.5.0

16 Mar 02:27

Choose a tag to compare

What's Changed

  • Implementing onPushNotificationWithPayloadData(title: String?, body: String?, data: PayloadData) listener callback by @chrisjenx in #110
  • Add Logger implementation by @zsmb13 in #121
  • Fix: Android only last payload data is received when multiple notifications are received by @mirzemehdi in #124
  • Fix: ios push notification is not shown when askPermissionOnStart is set false by @mirzemehdi in #125
  • Bumping kotlin to 2.1.0, and library deps by @mirzemehdi in #126
  • Fix: onPushNotificationWithPayloadData is called 2 times in ios by @mirzemehdi in #128

By default, internal logs are not printed, you can print as below, when initializing the library:

NotifierManager.setLogger { message ->
    println(message)
}

New onPushNotificationWithPayloadData(title: String?, body: String?, data: PayloadData) listener callback is created. For now, nothing is deprecated, but in future onPushNotification(title: String?, body: String?) and onPayloadData(data: PayloadData) can be deprecated in favor of this new listener callback, which effectively replaces two callback in one callback.


New Contributors

Full Changelog: v1.4.0...v1.5.0

v1.4.0

11 Dec 23:44
82e6de8

Choose a tag to compare

What's Changed

  • Customize notifications. Kotlin DSL syle, and Notification Image support by @mirzemehdi in #95
  • Adding setListener to set one listener or to remove existing listeners by @mirzemehdi in #94
  • Exposing KEY_URL and mutable to make it customizable by @mirzemehdi in #93
  • Returning null for Firebase get token when exception occurs by @mirzemehdi in #92
  • Bump lib deps by @mirzemehdi in #97

Now you can send notifications in kotlin dsl style, and finally sending images are supported both in android and ios 🎉🥳

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")
}

Full Changelog: v1.3.0...v1.4.0

v1.3.0

30 Sep 14:01

Choose a tag to compare

What's Changed

  • Adding Firebase push notification sender python code for testing by @mirzemehdi in #77
  • Add an option to initialize by passing Android Context instance by @mirzemehdi in #78
  • Bump dependencies: Kotlin 2.0.20, Koin: 4.0.0 by @mirzemehdi in #79

Full Changelog: v1.2.1...v1.3.0

v1.2.1

08 Aug 13:54
abaa656

Choose a tag to compare

What's Changed

  • Adding web support (js and wasm targets) by @mirzemehdi in #51
  • Fixing Ios notification bugs by @mirzemehdi in #56
  • Change onPermissionGranted to onPermissionResult(isGranted: Boolean) by @RemcoTaal in #55
  • Bump versions by @mirzemehdi in #58
  • Android deeplink support (send notifications with URI on Android devices) by @mirzemehdi in #60
  • Custom notification sound in android and ios by @mirzemehdi in #61

Breaking Changes

onPermissionGranted is replaced by onPermissionResult(isGranted: Boolean)

Custom notification sound in android and ios:

Add custom notification sound when initializing the library as below:

Android:

soundUri - Custom Notification sound, uri should be converted to String. Default value is null, if null default notification sound will be played. For custom notification sound put notification sound in res/raw directory. See how it is used in sample app: 3708ea8

val customNotificationSound =
        Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + "com.mmk.kmpnotifier.sample" + "/" + R.raw.custom_notification_sound)
    NotifierManager.initialize(
        configuration = NotificationPlatformConfiguration.Android(
            notificationIconResId = R.drawable.ic_launcher_foreground,
            showPushNotification = true,
            notificationChannelData = NotificationPlatformConfiguration.Android.NotificationChannelData(
                soundUri = customNotificationSound.toString()
            )
        )
    )

iOS:

notificationSoundName - Custom notification sound name. Default value is null. If set null, default notification sound will be played. For cusotm notification sound, place the file in the Resources directory of your iOS target. Ensure the file is added to your target's "Build Phases" under "Copy Bundle Resources". See how it is used in sample app: 4b2a90d

NotifierManager.initialize(
        NotificationPlatformConfiguration.Ios(
            showPushNotification = true,
            askNotificationPermissionOnStart = true,
            notificationSoundName = "custom_notification_sound.wav"
        )
    )

Android deeplink support (send notifications with URI on Android devices)

In order to setData for Intent on Android Devices, you just need to put URI value with "URL" key into payloadData (after converting URI toString). If payload data contains value with "URL" key then intent data will be set internally.

Example code:

//Notifier.KEY_URL value is set as "URL" in the library. If payload data contains that key, then its value will be set as intent data.

notifier.notify(
    title = "Title", 
    body = "bodyMessage", 
    payloadData = mapOf(
        Notifier.KEY_URL to "https://github.com/mirzemehdi/KMPNotifier/",
        "extraKey" to "randomValue"
    )
)

New Contributors

  • @RemcoTaal made their first contribution in #55

Full Changelog: v1.1.0...v1.2.1

v1.2.0-alpha02

06 Aug 02:07

Choose a tag to compare

What's Changed

  • Fixing Ios notification bugs by @mirzemehdi in #56
  • Change onPermissionGranted to onPermissionResult(isGranted: Boolean) by @RemcoTaal in #55

New Contributors

  • @RemcoTaal made their first contribution in #55

Full Changelog: v1.2.0-alpha...v1.2.0-alpha02

v1.2.0-alpha

19 Jul 15:14
4a3c59d

Choose a tag to compare

What's Changed

In web it can be initialized using new Web configuration

NotifierManager.initialize(
    NotificationPlatformConfiguration.Web(
      askNotificationPermissionOnStart = true,
      notificationIconPath = null
  )
)

Note:
If you are using mac make sure you also allow notifications for browser from system system settings in order to see web notifications

Full Changelog: v1.1.0...v1.2.0-alpha

v1.1.0

08 Jul 20:13
bcca06b

Choose a tag to compare

What's Changed

Full Changelog: v1.0.1...v1.1.0