Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit f7fbb2f

Browse files
authored
Merge pull request #935 from TwilioDevEd/DEVED-5467_conversations_ios_push_fixes
DEVED-5467: iOS Push Snippets - Fix tab spacing, two typos
2 parents a4c66df + 3cef5f9 commit f7fbb2f

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

conversations/push-ios/registernotifications/registernotifications.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
if (self.updatedPushToken) {
22
[self.conversationsClient registerWithNotificationToken:self.updatedPushToken
33
completion:^(TCHResult *result) {
4-
if (![result isSuccessful]) {
5-
// try registration again or verify token
6-
}
4+
if (![result isSuccessful]) {
5+
// try registration again or verify token
6+
}
77
}];
88
}
99

conversations/push-ios/remotenotifications/remotenotifications.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
22
if (self.conversationsClient && self.conversationsClient.user) {
3-
[self.TwilioConversationsClient registerWithNotificationToken:deviceToken
3+
[self.conversationsClient registerWithNotificationToken:deviceToken
44
completion:^(TCHResult *result) {
55
if (![result isSuccessful]) {
66
// try registration again or verify token
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
let center = UNUserNotificationCenter.current()
22
center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
3-
print("User allowed notifications:", granted)
4-
if granted {
5-
DispatchQueue.main.async {
6-
UIApplication.shared.registerForRemoteNotifications()
3+
print("User allowed notifications:", granted)
4+
if granted {
5+
DispatchQueue.main.async {
6+
UIApplication.shared.registerForRemoteNotifications()
7+
}
8+
} else {
9+
if error {
10+
print(error.localizedDescription)
11+
}
712
}
8-
} else {
9-
if error {
10-
print(error.localizedDescription)
11-
}
12-
}
1313
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
let center = UNUserNotificationCenter.current()
22
center.getNotificationSettings { (settings) in
3-
if settings.authorizationStatus == .authorized {
4-
DispatchQueue.main.async {
5-
UIApplication.shared.registerForRemoteNotifications()
3+
if settings.authorizationStatus == .authorized {
4+
DispatchQueue.main.async {
5+
UIApplication.shared.registerForRemoteNotifications()
6+
}
67
}
7-
}
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
var updatedPushToken: Data?
22
var receivedNotification: [AnyHashable: Any]?
3-
var conversationsClientClient: TwilioConversationsClient?
3+
var conversationsClient: TwilioConversationsClient?

0 commit comments

Comments
 (0)