Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push: Update code to follow API break #2582

Merged
merged 1 commit into from
Jul 16, 2019
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
2 changes: 1 addition & 1 deletion Riot/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2742,7 +2742,7 @@ - (void)initMatrixSessions
if (isPushRegistered)
{
// Enable push notifications by default on new added account
account.enablePushKitNotifications = YES;
[account enablePushKitNotifications:YES success:nil failure:nil];
}
else
{
Expand Down
12 changes: 10 additions & 2 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,11 @@ - (void)togglePushNotifications:(id)sender

if (accountManager.pushDeviceToken)
{
[account setEnablePushKitNotifications:!account.isPushKitNotificationActive];
[account enablePushKitNotifications:!account.isPushKitNotificationActive success:^{
[self stopActivityIndicator];
} failure:^(NSError *error) {
[self stopActivityIndicator];
}];
}
else
{
Expand All @@ -2887,7 +2891,11 @@ - (void)togglePushNotifications:(id)sender
}
else
{
[account setEnablePushKitNotifications:YES];
[account enablePushKitNotifications:YES success:^{
[self stopActivityIndicator];
} failure:^(NSError *error) {
[self stopActivityIndicator];
}];
}
}];
}
Expand Down