diff --git a/src/App/Services/PushNotificationListenerService.cs b/src/App/Services/PushNotificationListenerService.cs index 80adee2e132..8ce3367532d 100644 --- a/src/App/Services/PushNotificationListenerService.cs +++ b/src/App/Services/PushNotificationListenerService.cs @@ -187,10 +187,8 @@ await _apiService.Value.PutDeviceTokenAsync(appId, Debug.WriteLine($"{TAG} Registered device with server."); await _stateService.Value.SetPushLastRegistrationDateAsync(DateTime.UtcNow); - if (deviceType == Device.Android) - { - await _stateService.Value.SetPushCurrentTokenAsync(token); - } + + await _stateService.Value.SetPushCurrentTokenAsync(token); } #if DEBUG catch (ApiException apiEx) diff --git a/src/Core/Models/Request/DeviceRequest.cs b/src/Core/Models/Request/DeviceRequest.cs index a4cd687bba1..a2c1646e23b 100644 --- a/src/Core/Models/Request/DeviceRequest.cs +++ b/src/Core/Models/Request/DeviceRequest.cs @@ -5,10 +5,11 @@ namespace Bit.Core.Models.Request { public class DeviceRequest { - public DeviceRequest(string appId, IPlatformUtilsService platformUtilsService) + public DeviceRequest(string appId, string pushToken, IPlatformUtilsService platformUtilsService) { Type = platformUtilsService.GetDevice(); Name = platformUtilsService.GetDeviceString(); + PushToken = pushToken; Identifier = appId; } diff --git a/src/Core/Services/AuthService.cs b/src/Core/Services/AuthService.cs index db09798dbe3..ea47f777b89 100644 --- a/src/Core/Services/AuthService.cs +++ b/src/Core/Services/AuthService.cs @@ -300,7 +300,8 @@ private async Task LogInHelperAsync(string email, string hashedPassw { var storedTwoFactorToken = await _tokenService.GetTwoFactorTokenAsync(email); var appId = await _appIdService.GetAppIdAsync(); - var deviceRequest = new DeviceRequest(appId, _platformUtilsService); + var pushToken = await _stateService.GetPushCurrentTokenAsync(); + var deviceRequest = new DeviceRequest(appId, pushToken, _platformUtilsService); string[] emailPassword; string[] codeCodeVerifier;