Skip to content

Commit

Permalink
Merge pull request #2582 from vector-im/riot_2348
Browse files Browse the repository at this point in the history
Push: Update code to follow API break
  • Loading branch information
manuroe authored Jul 16, 2019
2 parents cf3b0b3 + 8ecf5e7 commit f0e099f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit f0e099f

Please sign in to comment.