mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
was added firebase nitifying
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Govor.Application.Interfaces.PushNotifications.Models;
|
||||
|
||||
namespace Govor.Application.Interfaces.PushNotifications;
|
||||
|
||||
public interface IPushNotificationProvider
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
Task<SendPushResult> SendToTokenAsync(string token, PushMessage message);
|
||||
|
||||
Task<SendPushResult> SendMulticastAsync(
|
||||
IReadOnlyList<string> tokens,
|
||||
PushMessage message);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Govor.Application.Interfaces.PushNotifications;
|
||||
|
||||
public interface IPushNotificationService
|
||||
{
|
||||
Task SendToUserAsync(Guid userId, string title, string body, string channelId, Dictionary<string, string>? data = null);
|
||||
|
||||
Task SendToUsersAsync(IEnumerable<Guid> userIds, string title, string body, string channelId, Dictionary<string, string>? data = null);
|
||||
|
||||
Task SendToSessionAsync(Guid sessionId, string title, string body, string channelId, Dictionary<string, string>? data = null);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Govor.Application.Interfaces.PushNotifications.Models;
|
||||
|
||||
public class PushMessage
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Body { get; set; } = string.Empty;
|
||||
public Dictionary<string, string> Data { get; set; } = new();
|
||||
public string? ChannelId { get; set; } = "chat_messages"; //for Android
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Govor.Application.Interfaces.PushNotifications.Models;
|
||||
|
||||
public record SendPushResult(int SuccessCount, int FailureCount, IEnumerable<string> FailedTokens);
|
||||
Reference in New Issue
Block a user