From 4cc5a443a21f2e8331953f64361f85b6fdc5a54c Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 4 Mar 2020 15:10:46 +0100 Subject: [PATCH] Push notifications: Avoid any automatic deactivation vector-im/riot-ios#3017 --- CHANGES.rst | 1 + Riot/AppDelegate.m | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 81176ef5aa..5236c5c983 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changes in 0.10.5 (TBD) Bug fix: * Fix error when joining some public rooms, thanks to @chrismoos (PR #2888). * Fix crash due to malformed widget (#2997). + * Push notifications: Avoid any automatic deactivation (vector-im/riot-ios#3017). Changes in 0.10.4 (2019-12-11) =============================================== diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 517395fb02..a126f8f7e7 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2069,9 +2069,13 @@ - (void)clearPushNotificationToken { NSLog(@"[AppDelegate][Push] clearPushNotificationToken: Clear existing token"); + // XXX: The following code has been commented to avoid automatic deactivation of push notifications + // There may be a race condition here where the clear happens after the update of the new push token. + // We have no evidence of this. This is a safety measure. + // Clear existing token - MXKAccountManager* accountManager = [MXKAccountManager sharedManager]; - [accountManager setPushDeviceToken:nil withPushOptions:nil]; + //MXKAccountManager* accountManager = [MXKAccountManager sharedManager]; + //[accountManager setPushDeviceToken:nil withPushOptions:nil]; } // Remove delivred notifications for a given room id except call notifications