{"id":28062670,"url":"https://github.com/timokoethe/notificationmanager","last_synced_at":"2025-05-12T11:42:17.188Z","repository":{"id":260213561,"uuid":"799232030","full_name":"timokoethe/NotificationManager","owner":"timokoethe","description":"A Swift package for effortlessly managing local notifications in your iOS app. Schedule, customize, and handle notifications with ease using our API.","archived":false,"fork":false,"pushed_at":"2024-05-31T14:39:49.000Z","size":11,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:03:30.446Z","etag":null,"topics":["ios","macos","spm","swift-package-manager","swiftpackage","swiftui","watchos"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/timokoethe/NotificationManager","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timokoethe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-11T14:23:32.000Z","updated_at":"2025-02-18T10:09:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"676f7931-0fab-42c4-a91e-e6d3fe88bd61","html_url":"https://github.com/timokoethe/NotificationManager","commit_stats":null,"previous_names":["timokoethe/notificationmanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timokoethe%2FNotificationManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timokoethe%2FNotificationManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timokoethe%2FNotificationManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timokoethe%2FNotificationManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timokoethe","download_url":"https://codeload.github.com/timokoethe/NotificationManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253731811,"owners_count":21955151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","macos","spm","swift-package-manager","swiftpackage","swiftui","watchos"],"created_at":"2025-05-12T11:42:12.393Z","updated_at":"2025-05-12T11:42:17.163Z","avatar_url":"https://github.com/timokoethe.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NotificationManager\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/license/mit)\n[![Build](https://github.com/timokoethe/NotificationManager/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/timokoethe/NotificationManager/actions/workflows/build.yml)\n[![Test](https://github.com/timokoethe/NotificationManager/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/timokoethe/NotificationManager/actions/workflows/test.yml)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftimokoethe%2FNotificationManager%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/timokoethe/NotificationManager)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftimokoethe%2FNotificationManager%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/timokoethe/NotificationManager)\n\nNotificationManager is a Swift Package to make your code easier for managing local notifications.\nThis package is supposed to make it possible to manage notifications in a highly intuitive way.\nIt shall also appear as minimalistic as possible.\n\n## Requirements\n- Xcode 15.0+\n- Swift 5.9+\n- macOS 10.15+\n- iOS 13.0+\n- visionOS 1.0+\n\n## Installation\n1.  Copy the resource url:\n```\nhttps://github.com/timokoethe/NotificationManager.git\n```\n2.  Open your Xcode project.\n3.  Navigate to _File_ / _Add Package Dependency_.\n4.  Paste the resource url at the top right corner in _Search or Enter Package URL_.\n5.  Choose the right target under _Add to project_.\n6.  To complete hit _Add Package_.\n\n## Setup\n1. Importing the Framework \u003cbr\u003e\nIn any Swift file where you want to use NotificationManager, add the following import statement:\n```import NotificationManager```\n\n2. Request notification authorization \u003cbr\u003e\nBefore your app can send notifications, you need to request permission from the user. This is typically done when the app first launches. Add the following code to your App struct or the place wherever you want to ask the user to permit:\n```\nimport SwiftUI\nimport UserNotifications\nimport NotificationManager\n\n@main\nstruct YourApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .onAppear {\n                    requestNotificationAuthorization()\n                }\n        }\n    }\n}\n```\n\n## Usage\n- Scheduling a Notification \u003cbr\u003e\nOnce you have authorization, you can schedule notifications. Here's an example of how to schedule a notification that should arrive after 10 seconds using NotificationManager by pushing a button:\n\n```\nimport SwiftUI\nimport NotificationManager\n\nstruct ContentView: View {\n    var body: some View {\n        VStack {\n            Button(\"Schedule\") {\n                NotificationManager.scheduleNotification(id: UUID().uuidString, title: \"Title\", body: \"Body\", triggerDate: Date()+10)\n            }\n        }\n    }\n}\n```\n\n- Getting pending notifications \u003cbr\u003e\nOnce you have scheduled one or more notifications you can get all pending:\n```\nimport SwiftUI\nimport NotificationManager\n\nstruct ContentView: View {\n    @State private var notifications = [UNNotificationRequest]()\n    var body: some View {\n        VStack {\n            Button(\"Get\") {\n                Task {\n                    notifications = await NotificationManager.getPendingNotificationRequests()\n                }\n            }\n        }\n    }\n}\n```\n\n- Removing all pending notifications \u003cbr\u003e\nAfter scheduling several notifications you can remove them easily:\n```\nimport SwiftUI\nimport NotificationManager\n\nstruct ContentView: View {\n    var body: some View {\n        VStack {\n            Button(\"Remove\") {\n                NotificationManager.removeAllPendingNotificationRequests()\n            }\n        }\n    }\n}\n```\n\n## Contributing\nWe welcome contributions from the community to help improve NotificationManager. If you encounter any bugs, have feature requests, or would like to contribute code, please feel free to open an issue or submit a pull request on our GitHub repository.\n\n## Support\nIf you have any questions, feedback, or need assistance with NotificationManager, please don't hesitate to contact us. We're here to help!\n\n## License\nNotificationManager is released under the [MIT License](https://opensource.org/license/mit).\n\nFeel free to adjust and expand upon this template to better suit your project's needs!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimokoethe%2Fnotificationmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimokoethe%2Fnotificationmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimokoethe%2Fnotificationmanager/lists"}