Class
AlarmScheduler
class AlarmScheduler
Alarm scheduling class to schedule alarm
Methods
scheduleNotification(title:dateComponents:id:)
func scheduleNotification(title: String, dateComponents: DateComponents, id: String?)
Function to schedule alarm for the first time after doanloaded from Firebase. Simply call this function and it will push the alarm to the OS notification center
Parameters
Name | Type | Description |
---|---|---|
title | String |
alarm identifier string |
dateComponents | DateComponents |
The date of the alarm when it should be triggered |
id | String? |
Firebase ID fetched from firebase just tracking the alarm data |
rescheduleNotification(title:id:)
public func rescheduleNotification(title: String, id: String?)
Reschedule alam once the the alarm is delayed
Parameters
Name | Type | Description |
---|---|---|
title | String |
alarm identifier string |
id | String? |
Firebase ID fetched from firebase just tracking the alarm data |
clearNotifications(title:)
func clearNotifications(title: String)
Request OS to remove notification from pending list and clear the notification list already delivered
Parameters
Name | Type | Description |
---|---|---|
title | String |
Alarm identifier string |