mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 03:33:36 +01:00
[AltServer] Fixes notifications not appearing on Catalina
This commit is contained in:
@@ -47,16 +47,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
|
|
||||||
self.connectedDevicesMenu.delegate = self
|
self.connectedDevicesMenu.delegate = self
|
||||||
|
|
||||||
if !UserDefaults.standard.didPresentInitialNotification
|
UNUserNotificationCenter.current().requestAuthorization(options: [.alert]) { (success, error) in
|
||||||
{
|
guard success else { return }
|
||||||
let content = UNMutableNotificationContent()
|
|
||||||
content.title = NSLocalizedString("AltServer Running", comment: "")
|
|
||||||
content.body = NSLocalizedString("AltServer runs in the background as a menu bar app listening for AltStore.", comment: "")
|
|
||||||
|
|
||||||
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
|
if !UserDefaults.standard.didPresentInitialNotification
|
||||||
UNUserNotificationCenter.current().add(request)
|
{
|
||||||
|
let content = UNMutableNotificationContent()
|
||||||
UserDefaults.standard.didPresentInitialNotification = true
|
content.title = NSLocalizedString("AltServer Running", comment: "")
|
||||||
|
content.body = NSLocalizedString("AltServer runs in the background as a menu bar app listening for AltStore.", comment: "")
|
||||||
|
|
||||||
|
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
|
||||||
|
UNUserNotificationCenter.current().add(request)
|
||||||
|
|
||||||
|
UserDefaults.standard.didPresentInitialNotification = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user