mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
去掉临时通知权限
This commit is contained in:
parent
204bed637f
commit
469b234c5a
@ -59,7 +59,7 @@ class Client: NSObject {
|
|||||||
|
|
||||||
func registerForRemoteNotifications() {
|
func registerForRemoteNotifications() {
|
||||||
let center = UNUserNotificationCenter.current()
|
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 {
|
if granted {
|
||||||
dispatch_sync_safely_main_queue {
|
dispatch_sync_safely_main_queue {
|
||||||
UIApplication.shared.registerForRemoteNotifications()
|
UIApplication.shared.registerForRemoteNotifications()
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class HomeViewController: BaseViewController<HomeViewModel> {
|
|||||||
let startRequestAuthorization: () -> Observable<Bool> = {
|
let startRequestAuthorization: () -> Observable<Bool> = {
|
||||||
Single<Bool>.create { single -> Disposable in
|
Single<Bool>.create { single -> Disposable in
|
||||||
let center = UNUserNotificationCenter.current()
|
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))
|
single(.success(granted))
|
||||||
})
|
})
|
||||||
return Disposables.create()
|
return Disposables.create()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user