Alert-KMP is a Kotlin Multiplatform (KMP) library designed to facilitate native notification displays across Android, iOS, Web, and Desktop platforms using JetBrains Compose Multiplatform. It provides a unified API for triggering notifications that seamlessly integrates into Kotlin's multiplatform ecosystem.
- Platform Agnostic: Supports Android, iOS, Web, and Desktop platforms through Kotlin Multiplatform.
- Compose Multiplatform Integration: Seamlessly integrates with JetBrains Compose Multiplatform UI framework.
- Customizable Notifications: Easily customize notification content, icons, actions, and behaviors to suit application needs.
- Event Handling: Provides callbacks and event listeners for notification actions and dismissal.
- Local Notifications Support
- FCM Implementation
- Schedule Native Notifications
You can include Alert-KMP in your project by adding the following dependency:
Version Catalog
[versions]
alertKmp = "2.0.0"
[libraries]
alert-kmp = { module = "io.github.khubaibkhan4:alert-kmp", version.ref = "alertKmp" }
implementation("io.github.khubaibkhan4:alert-kmp:2.0.0")
**alert-kmp-jvm**
implementation("io.github.khubaibkhan4:alert-kmp-jvm:2.0.0")
**alert-kmp-android**
implementation("io.github.khubaibkhan4:alert-kmp-android:2.0.0")
**alert-kmp-js**
implementation("io.github.khubaibkhan4:alert-kmp-js:2.0.0")
**alert-kmp-wasm-js**
implementation("io.github.khubaibkhan4:alert-kmp-wasm-js:2.0.0")
import io.github.khubaibkhan4.alert.Notification
import io.github.khubaibkhan4.alert.NotificationType
import io.github.khubaibkhan4.alert.createNotification
fun main() {
val notification = createNotification(NotificationType.TOAST)
notification.show("Hello, World!")
OR
Notify(message= "Hellow World!", duration=NotificationDuration.SHORT)
}
The library supports multiple notification types:
- NotificationType.TOAST - Displays a toast message.
- NotificationType.ALERT - Displays an alert dialog.
- NotificationType.TOP - Displays a notification at the top of the screen.
- NotificationType.CUSTOM - Displays a custom notification (implementations vary by platform).
- System Level Notificationa.
Let's chat about potential projects, job opportunities, or any other collaboration! Feel free to connect with me through the following channels:
https://github.com/user-attachments/assets/484e976a-0b8d-47fa-84d6-53b3d4733aaa https://github.com/user-attachments/assets/bd642ecb-55e1-4441-b3fe-a44eb6b84c2d
demo.mp4
Stargazers
Forkers
We welcome contributions to the Alert-KMP Library Project! To contribute, please follow these guidelines:
- Reporting Bugs: If you encounter a bug, please open an issue and provide detailed information about the bug, including steps to reproduce it.
- Suggesting Features: We encourage you to suggest new features or improvements by opening an issue and describing your idea.
- Submitting Pull Requests: If you'd like to contribute code, please fork the repository, create a new branch for your changes, and submit a pull request with a clear description of the changes.
We expect all contributors and users of the Alert-KMP Library Project to adhere to our code of conduct. Please review the Code of Conduct for details on expected behavior and reporting procedures.