From 3cef5f90d90a7100f4541231fa924a5ce3828087 Mon Sep 17 00:00:00 2001 From: Jeff Linwood Date: Wed, 4 Aug 2021 09:02:17 -0600 Subject: [PATCH] Fix tab spacing, two typos --- .../registernotifications.m | 6 +++--- .../remotenotifications/remotenotifications.m | 2 +- .../push-ios/systemversion/systemversion.swift | 18 +++++++++--------- .../usernotificationsettings.swift | 8 ++++---- .../push-ios/variables/variables.swift | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/conversations/push-ios/registernotifications/registernotifications.m b/conversations/push-ios/registernotifications/registernotifications.m index 862493fb1..80e188e2a 100644 --- a/conversations/push-ios/registernotifications/registernotifications.m +++ b/conversations/push-ios/registernotifications/registernotifications.m @@ -1,9 +1,9 @@ if (self.updatedPushToken) { [self.conversationsClient registerWithNotificationToken:self.updatedPushToken completion:^(TCHResult *result) { - if (![result isSuccessful]) { - // try registration again or verify token - } + if (![result isSuccessful]) { + // try registration again or verify token + } }]; } diff --git a/conversations/push-ios/remotenotifications/remotenotifications.m b/conversations/push-ios/remotenotifications/remotenotifications.m index df73e7084..dc8e80ad3 100644 --- a/conversations/push-ios/remotenotifications/remotenotifications.m +++ b/conversations/push-ios/remotenotifications/remotenotifications.m @@ -1,6 +1,6 @@ - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { if (self.conversationsClient && self.conversationsClient.user) { - [self.TwilioConversationsClient registerWithNotificationToken:deviceToken + [self.conversationsClient registerWithNotificationToken:deviceToken completion:^(TCHResult *result) { if (![result isSuccessful]) { // try registration again or verify token diff --git a/conversations/push-ios/systemversion/systemversion.swift b/conversations/push-ios/systemversion/systemversion.swift index df0c3ce72..9e6926ab2 100644 --- a/conversations/push-ios/systemversion/systemversion.swift +++ b/conversations/push-ios/systemversion/systemversion.swift @@ -1,13 +1,13 @@ let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in - print("User allowed notifications:", granted) - if granted { - DispatchQueue.main.async { - UIApplication.shared.registerForRemoteNotifications() + print("User allowed notifications:", granted) + if granted { + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + } else { + if error { + print(error.localizedDescription) + } } - } else { - if error { - print(error.localizedDescription) - } - } } diff --git a/conversations/push-ios/usernotificationsettings/usernotificationsettings.swift b/conversations/push-ios/usernotificationsettings/usernotificationsettings.swift index c9c02df8d..f9625af10 100644 --- a/conversations/push-ios/usernotificationsettings/usernotificationsettings.swift +++ b/conversations/push-ios/usernotificationsettings/usernotificationsettings.swift @@ -1,8 +1,8 @@ let center = UNUserNotificationCenter.current() center.getNotificationSettings { (settings) in - if settings.authorizationStatus == .authorized { - DispatchQueue.main.async { - UIApplication.shared.registerForRemoteNotifications() + if settings.authorizationStatus == .authorized { + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } } - } } diff --git a/conversations/push-ios/variables/variables.swift b/conversations/push-ios/variables/variables.swift index 468189d3d..8638a4efc 100644 --- a/conversations/push-ios/variables/variables.swift +++ b/conversations/push-ios/variables/variables.swift @@ -1,3 +1,3 @@ var updatedPushToken: Data? var receivedNotification: [AnyHashable: Any]? -var conversationsClientClient: TwilioConversationsClient? +var conversationsClient: TwilioConversationsClient?