Skip to content

Alert-KMP is a Kotlin Multiplatform (KMP) library designed to facilitate native notification displays across Android, iOS, Web, and Desktop

License

Notifications You must be signed in to change notification settings

KhubaibKhan4/Alert-KMP

Repository files navigation

Alert-KMP

Maven Central GitHub License GitHub Issues GitHub Pull Requests GitHub Last Commit GitHub Stars

Supported Platforms Supported Platforms Supported Platforms Supported Platforms Supported Platforms Android CI

Overview

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.

Features

  • 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

Plans

  • FCM Implementation
  • Schedule Native Notifications

Installation

You can include Alert-KMP in your project by adding the following dependency:

Compose Multiplatform Setup

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

Platform Specific

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


Usage

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

Notification Types

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).

Future Plan's

  • System Level Notificationa.

🀝 Connect with Me

Let's chat about potential projects, job opportunities, or any other collaboration! Feel free to connect with me through the following channels:

LinkedIn Twitter Email

πŸ’° You can help me by Donating

BuyMeACoffee PayPal Patreon Ko-Fi

Screenshots

| Mobile Screenshot | Screenshot 2 Screenshot 3

Web Toast

Screenshot 2024-07-19 114919

Web Top Toast

Screenshot 2024-07-19 115339

Web Custom

Screenshot 2024-07-19 115753

Desktop

Screenshot 2024-07-19 120052

iOS Alerts

https://github.com/user-attachments/assets/484e976a-0b8d-47fa-84d6-53b3d4733aaa https://github.com/user-attachments/assets/bd642ecb-55e1-4441-b3fe-a44eb6b84c2d

Demo

demo.mp4

Star History

Star History Chart

Stargazers

Stargazers repo roster for @KhubaibKhan4/Alert-KMP

Forkers

Forkers repo roster for @KhubaibKhan4/Alert-KMP

Contribution Guidelines

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.

Code of Conduct

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.