Skip to content

Commit

Permalink
Push notifications: Avoid any automatic deactivation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Apr 1, 2020
1 parent 7bae95a commit 4cc5a44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
===============================================
Expand Down
8 changes: 6 additions & 2 deletions Riot/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cc5a44

Please sign in to comment.