From 469b234c5a4f97ee64000ee60f13e2261a428b0e Mon Sep 17 00:00:00 2001 From: Fin Date: Thu, 22 May 2025 12:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=B4=E6=97=B6=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common/Client.swift | 2 +- Controller/HomeViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/Client.swift b/Common/Client.swift index 650ead3..20b10bf 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, .provisional], completionHandler: { (_ granted: Bool, _: Error?) in + center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert], 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 56f404c..e0508c0 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, .provisional], completionHandler: { (_ granted: Bool, _: Error?) in + center.requestAuthorization(options: [.alert, .sound, .badge, .criticalAlert], completionHandler: { (_ granted: Bool, _: Error?) in single(.success(granted)) }) return Disposables.create()