diff --git a/Common/Client.swift b/Common/Client.swift index 20b10bf..650ead3 100644 --- a/Common/Client.swift +++ b/Common/Client.swift @@ -59,7 +59,7 @@ class Client: NSObject { func registerForRemoteNotifications() { let center = UNUserNotificationCenter.current() - center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert], completionHandler: { (_ granted: Bool, _: Error?) in + center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert, .provisional], completionHandler: { (_ granted: Bool, _: Error?) in if granted { dispatch_sync_safely_main_queue { UIApplication.shared.registerForRemoteNotifications() diff --git a/Controller/HomeViewController.swift b/Controller/HomeViewController.swift index e0508c0..56f404c 100644 --- a/Controller/HomeViewController.swift +++ b/Controller/HomeViewController.swift @@ -87,7 +87,7 @@ class HomeViewController: BaseViewController { let startRequestAuthorization: () -> Observable = { Single.create { single -> Disposable in let center = UNUserNotificationCenter.current() - center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert], completionHandler: { (_ granted: Bool, _: Error?) in + center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert, .provisional], completionHandler: { (_ granted: Bool, _: Error?) in single(.success(granted)) }) return Disposables.create()