47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using DysonNetwork.Shared.Models;
|
|
using MagicOnion;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DysonNetwork.Shared.Services;
|
|
|
|
public interface INotificationService : IService<INotificationService>
|
|
{
|
|
/// <summary>
|
|
/// Unsubscribes a device from push notifications
|
|
/// </summary>
|
|
/// <param name="deviceId">The device ID to unsubscribe</param>
|
|
Task UnsubscribePushNotifications(string deviceId);
|
|
|
|
/// <summary>
|
|
/// Subscribes a device to push notifications
|
|
/// </summary>
|
|
Task<NotificationPushSubscription> SubscribePushNotification(
|
|
Account account,
|
|
NotificationPushProvider provider,
|
|
string deviceId,
|
|
string deviceToken
|
|
);
|
|
|
|
Task<Notification> SendNotification(
|
|
Account account,
|
|
string topic,
|
|
string? title = null,
|
|
string? subtitle = null,
|
|
string? content = null,
|
|
Dictionary<string, object>? meta = null,
|
|
string? actionUri = null,
|
|
bool isSilent = false,
|
|
bool save = true
|
|
);
|
|
|
|
Task DeliveryNotification(Notification notification);
|
|
|
|
Task MarkNotificationsViewed(ICollection<Notification> notifications);
|
|
|
|
Task BroadcastNotification(Notification notification, bool save = false);
|
|
|
|
Task SendNotificationBatch(Notification notification, List<Account> accounts,
|
|
bool save = false);
|
|
}
|