File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
ip-messaging/pushiOS/usernotificationsettings Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 1- func application( application: UIApplication , didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings ) {
2- if notificationSettings. types == . None {
3- NSLog ( " Failed to get token, error: Notifications are not allowed " )
4- if let chatClient = chatClient where chatClient. userInfo != nil {
5- chatClient. registerWithToken ( nil )
6- } else {
7- updatedPushToken = nil
8- }
1+ let center = UNUserNotificationCenter . current ( )
2+ center. getNotificationSettings { ( settings) in
3+ if settings. authorizationStatus == . authorized {
4+ DispatchQueue . main. async {
5+ UIApplication . shared. registerForRemoteNotifications ( )
96 }
10- else {
11- UIApplication . sharedApplication ( ) . registerForRemoteNotifications ( )
12- }
13- }
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments