1
0
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:
Kyle Spearrin
2016-06-21 22:29:29 -04:00
parent 0f5b2f5721
commit 4cfa8e2dee
18 changed files with 154 additions and 15 deletions

View File

@@ -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; }
}
}

View File

@@ -0,0 +1,12 @@
namespace Bit.App.Models.Api
{
public class DeviceTokenRequest
{
public DeviceTokenRequest(string token)
{
PushToken = token;
}
public string PushToken { get; set; }
}
}

View File

@@ -4,5 +4,6 @@
{
public string Email { get; set; }
public string MasterPasswordHash { get; set; }
public DeviceRequest Device { get; set; }
}
}

View File

@@ -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; }
}