[U] Update alarm instantiation
This commit is contained in:
@@ -17,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
{
|
{
|
||||||
// Init default settings
|
// Init default settings
|
||||||
localStorage.register(defaults: [
|
localStorage.register(defaults: [
|
||||||
"alarms": JSON.stringify([Alarm(alarmTime: Date(), text: "Wake up lol", wakeMethod: wvms[0])])!
|
"alarms": JSON.stringify([Alarm(enabled: true, alarmTime: Date(), text: "Wake up lol", wakeMethod: wvms[0])])!
|
||||||
])
|
])
|
||||||
|
|
||||||
// Start alarm activator
|
// Start alarm activator
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class TestingViewController: UIViewController {
|
|||||||
|
|
||||||
//Sends a test notification
|
//Sends a test notification
|
||||||
@IBAction func sendNotification(_ sender: Any) {
|
@IBAction func sendNotification(_ sender: Any) {
|
||||||
let alarm = Alarm(alarmTime: Date(), text: "Good morning!", wakeMethod: WVM(name: "walking", desc: "Walk"))
|
let alarm = Alarm(enabled: true, alarmTime: Date(), text: "Good morning!", wakeMethod: WVM(name: "walking", desc: "Walk"))
|
||||||
|
|
||||||
let content = UNMutableNotificationContent()
|
let content = UNMutableNotificationContent()
|
||||||
|
|
||||||
@@ -51,7 +51,6 @@ class TestingViewController: UIViewController {
|
|||||||
let attachment = try! UNNotificationAttachment(identifier: imageName, url: imageURL, options: .none)
|
let attachment = try! UNNotificationAttachment(identifier: imageName, url: imageURL, options: .none)
|
||||||
content.attachments = [attachment]
|
content.attachments = [attachment]
|
||||||
|
|
||||||
|
|
||||||
// Readies notification to be sent
|
// Readies notification to be sent
|
||||||
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false)
|
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false)
|
||||||
let request = UNNotificationRequest(identifier: "notification.id.01", content: content, trigger: trigger)
|
let request = UNNotificationRequest(identifier: "notification.id.01", content: content, trigger: trigger)
|
||||||
|
|||||||
Reference in New Issue
Block a user