From a70bec46f1d3ec9ab98b3cb6dbf8305ff4f8c207 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 16 Jul 2019 14:42:25 +0200 Subject: [PATCH] Push: Update code to follow API break #2348 --- Riot/AppDelegate.m | 2 +- Riot/Modules/Settings/SettingsViewController.m | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 276c6657d..db380b2ec 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2742,7 +2742,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (isPushRegistered) { // Enable push notifications by default on new added account - account.enablePushKitNotifications = YES; + [account enablePushKitNotifications:YES success:nil failure:nil]; } else { diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 4cccbedf2..b8e545a09 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -2874,7 +2874,11 @@ SignOutAlertPresenterDelegate> if (accountManager.pushDeviceToken) { - [account setEnablePushKitNotifications:!account.isPushKitNotificationActive]; + [account enablePushKitNotifications:!account.isPushKitNotificationActive success:^{ + [self stopActivityIndicator]; + } failure:^(NSError *error) { + [self stopActivityIndicator]; + }]; } else { @@ -2887,7 +2891,11 @@ SignOutAlertPresenterDelegate> } else { - [account setEnablePushKitNotifications:YES]; + [account enablePushKitNotifications:YES success:^{ + [self stopActivityIndicator]; + } failure:^(NSError *error) { + [self stopActivityIndicator]; + }]; } }]; }