1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

push notification services

This commit is contained in:
Kyle Spearrin
2019-05-28 12:01:55 -04:00
parent faccb61a6b
commit 3f11fdaa82
24 changed files with 1982 additions and 1256 deletions

View File

@@ -45,5 +45,6 @@ namespace Bit.Core.Abstractions
string organizationId);
Task<List<BreachAccountResponse>> GetHibpBreachAsync(string username);
Task PostTwoFactorEmailAsync(TwoFactorEmailRequest request);
Task PutDeviceTokenAsync(string identifier, DeviceTokenRequest request);
}
}

View File

@@ -16,6 +16,10 @@
public static string AccessibilityAutofillPasswordFieldKey = "accessibilityAutofillPasswordField";
public static string AccessibilityAutofillPersistNotificationKey = "accessibilityAutofillPersistNotification";
public static string DisableFaviconKey = "disableFavicon";
public static string PushRegisteredTokenKey = "pushRegisteredToken";
public static string PushCurrentTokenKey = "pushCurrentToken";
public static string PushLastRegistrationDateKey = "pushLastRegistrationDate";
public static string PushInitialPromptShownKey = "pushInitialPromptShown";
public const int SelectFileRequestCode = 42;
public const int SelectFilePermissionRequestCode = 43;
}

View File

@@ -0,0 +1,7 @@
namespace Bit.Core.Models.Request
{
public class DeviceTokenRequest
{
public string PushToken { get; set; }
}
}

View File

@@ -4,10 +4,12 @@ using System.Collections.Generic;
namespace Bit.Core.Models.Response
{
public class PushNotificationResponse
public class NotificationResponse
{
public string ContextId { get; set; }
public NotificationType Type { get; set; }
public string Payload { get; set; }
public object PayloadObject { get; set; }
}
public class SyncCipherNotification

View File

@@ -281,6 +281,16 @@ namespace Bit.Core.Services
#endregion
#region Device APIs
public Task PutDeviceTokenAsync(string identifier, DeviceTokenRequest request)
{
return SendAsync<DeviceTokenRequest, object>(
HttpMethod.Post, $"identifier/{identifier}/token", request, true, false);
}
#endregion
#region HIBP APIs
public Task<List<BreachAccountResponse>> GetHibpBreachAsync(string username)