mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 15:53:44 +00:00
push notification services
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
7
src/Core/Models/Request/DeviceTokenRequest.cs
Normal file
7
src/Core/Models/Request/DeviceTokenRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Bit.Core.Models.Request
|
||||
{
|
||||
public class DeviceTokenRequest
|
||||
{
|
||||
public string PushToken { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user