- add low battery notification with option to select battery level (disabled/3%/5%/10%/15%/20%/30%/40%/50%)

This commit is contained in:
Serhiy Mytrovtsiy
2020-07-15 22:18:24 +02:00
parent eaeeb476ac
commit 706e8219ce
7 changed files with 152 additions and 10 deletions

View File

@@ -67,14 +67,8 @@ extension AppDelegate {
}
if IsNewestVersion(currentVersion: prevVersion, latestVersion: currentVersion) {
let notification = NSUserNotification()
notification.identifier = "updated-from-\(prevVersion)-to-\(currentVersion)"
notification.title = "Successfully updated"
notification.subtitle = "Stats was updated to the v\(currentVersion)"
notification.soundName = NSUserNotificationDefaultSoundName
notification.hasActionButton = false
NSUserNotificationCenter.default.deliver(notification)
showNotification(title: "Successfully updated", subtitle: "Stats was updated to the v\(currentVersion)", id: "updated-from-\(prevVersion)-to-\(currentVersion)"
)
}
os_log(.debug, log: log, "Detected previous version %s. Current version (%s) set", prevVersion, currentVersion)