Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
}
}];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question here, are we not using anymore TwilioConversationsClient Module? or in this case we just needed to fix it and call the function instead? thanks!

completion:^(TCHResult *result) {
if (![result isSuccessful]) {
// try registration again or verify token
Expand Down
18 changes: 9 additions & 9 deletions conversations/push-ios/systemversion/systemversion.swift
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
Original file line number Diff line number Diff line change
@@ -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()
}
}
}
}
2 changes: 1 addition & 1 deletion conversations/push-ios/variables/variables.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var updatedPushToken: Data?
var receivedNotification: [AnyHashable: Any]?
var conversationsClientClient: TwilioConversationsClient?
var conversationsClient: TwilioConversationsClient?