Contents

ersanq/notificationkit

A simple, modern, and async-await first library for managing local notifications in SwiftUI.

Features

  • Zero Boilerplate: Send notifications with a single line of code.
  • Async/Await: Built-in support for the latest Swift concurrency.
  • Auto-Permissions: Automatically requests user permission when scheduling.
  • Flexible Scheduling: Schedule after a delay or at a specific date.
  • Identifier Support: Easily track and cancel individual notifications.

Supported Platforms

  • iOS 14.0+
  • macOS 11.0+

Installation

.package(url: "https://github.com/ErsanQ/NotificationKit", from: "1.0.0")

Usage

Simple Delay

import NotificationKit

await NotificationKit.shared.send("Hello!", body: "This is a quick notification after 5 seconds", after: 5)

Schedule at Date

let tomorrowAtMorning = Calendar.current.date(bySettingHour: 9, minute: 0, second: 0, of: Date())!

await NotificationKit.shared.schedule("Morning Routine", body: "Time to start your day!", at: tomorrowAtMorning)

Cancel Notifications

NotificationKit.shared.cancelAll()
NotificationKit.shared.cancel(ids: ["user_id_123"])

License

MIT License.

Author

ErsanQ (Swift Package Index Community)

Package Metadata

Repository: ersanq/notificationkit

Default branch: main

README: README.md