Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
Update Functionality
  • Loading branch information
timokoethe committed May 27, 2024
1 parent 5adfcf4 commit 0cdf431
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions Sources/NotificationManager/NotificationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,35 +88,6 @@ public struct NotificationManager {
}
}

/// Schedules a notification to arrive after a certain time interval in seconds from now.
/// - Parameters:
/// - id: unique id of the notification
/// - title: title of the notification that should be shown
/// - body: body of the notification that should be shown
/// - timeInterval: time interval in seconds from now when the notification should arrive
public static func scheduleNotification(id: String, title: String, body: String, timeInterval: Int) {
if timeInterval > 0 {
//Content
let content = UNMutableNotificationContent()
content.title = title
content.body = body
content.sound = .default

//Trigger
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: TimeInterval(timeInterval), repeats: false)

//Request
let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger)

//Schedule
center.add(request) { (error) in
if let error = error {
print("Error: " + error.localizedDescription)
}
}
}
}

/// Schedules a notification to arrive after a certain time interval in seconds from now.
/// - Parameters:
/// - id: unique id of the notification
Expand Down

0 comments on commit 0cdf431

Please sign in to comment.