mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Unregister the user from APNs when they clear their account
This commit is contained in:
parent
5f98392803
commit
ad8cb4f243
1 changed files with 7 additions and 0 deletions
|
@ -936,6 +936,13 @@ static NSTimeInterval launchStartedAt;
|
|||
|
||||
- (void)handleDataNukeRequested:(NSNotification *)notification
|
||||
{
|
||||
NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
BOOL isUsingFullAPNs = [userDefaults boolForKey:@"isUsingFullAPNs"];
|
||||
NSString *hexEncodedDeviceToken = [userDefaults stringForKey:@"deviceToken"];
|
||||
if (isUsingFullAPNs && hexEncodedDeviceToken != nil) {
|
||||
NSData *deviceToken = [NSData dataFromHexString:hexEncodedDeviceToken];
|
||||
[[LKPushNotificationManager registerWithToken:deviceToken isForcedUpdate:YES] retainUntilComplete]; // This actually unregisters the user; we should rename the function
|
||||
}
|
||||
[ThreadUtil deleteAllContent];
|
||||
[SSKEnvironment.shared.messageSenderJobQueue clearAllJobs];
|
||||
[SSKEnvironment.shared.identityManager clearIdentityKey];
|
||||
|
|
Loading…
Reference in a new issue