mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 03:03:46 +00:00
device registration on login
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
using PushNotification.Plugin.Abstractions;
|
||||
using Bit.App.Abstractions;
|
||||
using Plugin.DeviceInfo.Abstractions;
|
||||
using PushNotification.Plugin.Abstractions;
|
||||
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class DeviceRequest
|
||||
{
|
||||
public DeviceRequest() { }
|
||||
|
||||
public DeviceRequest(IAppIdService appIdService, IDeviceInfo deviceInfo)
|
||||
{
|
||||
Identifier = appIdService.AppId;
|
||||
Name = deviceInfo.Model;
|
||||
Type = deviceInfo.Platform == Platform.Android ? DeviceType.Android : DeviceType.iOS;
|
||||
}
|
||||
|
||||
public DeviceType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string PushToken { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
12
src/App/Models/Api/Request/DeviceTokenRequest.cs
Normal file
12
src/App/Models/Api/Request/DeviceTokenRequest.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Bit.App.Models.Api
|
||||
{
|
||||
public class DeviceTokenRequest
|
||||
{
|
||||
public DeviceTokenRequest(string token)
|
||||
{
|
||||
PushToken = token;
|
||||
}
|
||||
|
||||
public string PushToken { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,6 @@
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public string MasterPasswordHash { get; set; }
|
||||
public DeviceRequest Device { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Bit.App.Models.Api
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public DeviceType Type { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user