We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f7e6c5 commit 6089fd6Copy full SHA for 6089fd6
ip-messaging/pushiOS/systemversion/systemversion.swift
@@ -1,7 +1,10 @@
1
let center = UNUserNotificationCenter.current()
2
center.requestAuthorization(options: [.alert, .badge, .sound]) {
3
- (granted, error) in
4
- print("User allowed notifications:", granted)
5
-}
6
-UIApplication.shared.registerForRemoteNotifications()
7
-
+ (granted, error) in
+ print("User allowed notifications:", granted)
+ if granted {
+ DispatchQueue.main.async {
+ UIApplication.shared.registerForRemoteNotifications()
8
+ }
9
10
+}
0 commit comments