Skip to content

tsleedev/TSUserNotifications

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

TSUserNotifications

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Swift Package Manager

To use TSAdView with the Swift Package Manager, add the following to your Package.swift file.

.package(url: "https://github.com/tsleedev/TSUserNotifications.git", .upToNextMajor(from: "1.0.1"))

Usage

Specific date

TSUserNotificationCenter.set(identifier: "test",
                             date: Date(),
                             repeatType: .none,
                             title: "test",
                             subtitle: nil,
                             body: "It's test.",
                             badge: nil,
                             sound: nil,
                             userInfo: nil,
                             threadIdentifier: nil)

Weekly repeat

TSUserNotificationCenter.setDayOfTheWeek(identifier: "WEEK",
                                         hour: 14,
                                         minute: 30,
                                         dayOfTheWeeks: [.sunday, .monday, .tuesday, .wednesday, .thursday, .friday, .saturday],
                                         title: "weekly repeat test",
                                         subtitle: nil,
                                         body: "It's weekly repeat test.",
                                         badge: nil,
                                         sound: nil,
                                         userInfo: nil,
                                         threadIdentifier: nil)

Automatic calculation

let userNotifications = [
    TSUserNotification(identifier: "task1",
                       date: "2020-01-01".date!,
                       repeatType: .none,
                       title: "2020-01-01 none"),
    TSUserNotification(identifier: "task2",
                       date: "2025-12-24".date!,
                       repeatType: .none,
                       title: "2025-12-24 none"),
    TSUserNotification(identifier: "task3",
                       date: "2021-01-01".date!,
                       repeatType: .day,
                       title: "2021-01-01 day"),
    TSUserNotification(identifier: "task4",
                       date: "2021-01-01".date!,
                       repeatType: .week,
                       title: "2020-01-01(Fri) week")
    ]
    
TSUserNotificationCenter.removeContain(identifier: Identifier.task)
TSUserNotificationCenter.set(notifications: userNotifications, max: 10)

If today is June 29,

Author

taesu, tslee.dev@gmail.com

License

TSUserNotifications is available under the MIT license. See the LICENSE file for more info.