Skip to content

Commit 6089fd6

Browse files
author
Twilio CMS User
committed
CMS update of ip-messaging/pushiOS/systemversion by jlinwood@twilio.com
1 parent 7f7e6c5 commit 6089fd6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
let center = UNUserNotificationCenter.current()
22
center.requestAuthorization(options: [.alert, .badge, .sound]) {
3-
(granted, error) in
4-
print("User allowed notifications:", granted)
5-
}
6-
UIApplication.shared.registerForRemoteNotifications()
7-
3+
(granted, error) in
4+
print("User allowed notifications:", granted)
5+
if granted {
6+
DispatchQueue.main.async {
7+
UIApplication.shared.registerForRemoteNotifications()
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)