Class PushNotificationServiceManager
Inheritance
PushNotificationServiceManager
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class PushNotificationServiceManager : IPushNotificationServiceManager
Constructors
PushNotificationServiceManager(int)
Declaration
public PushNotificationServiceManager(int associateId)
Parameters
Type |
Name |
Description |
int |
associateId |
|
Properties
IncludeUpdatedBadgeCount
Declaration
public bool IncludeUpdatedBadgeCount { get; set; }
Property Value
SendMessageToOurself
If true, we will also send messages to logged in user if specified as recipient
If false, we will filter out logged in user
Declaration
public bool SendMessageToOurself { get; set; }
Property Value
SilentExceptions
If true, exceptions are being catched and logged instead of thrown
Declaration
public bool SilentExceptions { get; set; }
Property Value
UpdateSentMessageCounters
Declaration
public bool UpdateSentMessageCounters { get; set; }
Property Value
Methods
Declaration
protected string[] GetAvailableTags()
Returns
Declaration
protected string GetCompleteTagString(string inputTags)
Parameters
Type |
Name |
Description |
string |
inputTags |
|
Returns
GetInvitationCountAsync(int, CancellationToken)
Declaration
public static Task<int> GetInvitationCountAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Returns
GetPushNotificationRowsAsync(PushNotificationType, CancellationToken)
Declaration
public Task<IEnumerable<PushNotificationServiceRow>> GetPushNotificationRowsAsync(PushNotificationType type, CancellationToken cancellationToken = default)
Parameters
Returns
GetPushNotificationRowsAsync(IEnumerable<int>, PushNotificationType, bool, CancellationToken)
Declaration
public IAsyncEnumerable<PushNotificationServiceRow> GetPushNotificationRowsAsync(IEnumerable<int> associateIds, PushNotificationType type, bool overrideTagSettings, CancellationToken cancellationToken = default)
Parameters
Returns
GetQuoteNotificationCountAsync(int, CancellationToken)
Declaration
public static Task<int> GetQuoteNotificationCountAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Returns
GetRegisteredDevicesAsync(int, CancellationToken)
Declaration
public IAsyncEnumerable<DeviceInfo> GetRegisteredDevicesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Returns
GetTagFromPushNotificationType(PushNotificationType)
Declaration
public static string GetTagFromPushNotificationType(PushNotificationType type)
Parameters
Type |
Name |
Description |
PushNotificationType |
type |
|
Returns
Declaration
public Task<string> GetTagsAsync(int associateId, string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
Returns
Declaration
public Task<string> GetTagsAsync(string deviceIdentifier, CancellationToken cancellationToken = default)
Parameters
Returns
GetTicketNotificationCountAsync(int, CancellationToken)
Declaration
public static Task<int> GetTicketNotificationCountAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Returns
GetTranslatedMessageAsync(PushNotificationMessage, string, int, CancellationToken)
Declaration
protected virtual Task<PushNotificationMessage> GetTranslatedMessageAsync(PushNotificationMessage originalMessage, string language, int recipientPreferredTimeZoneId, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
PushNotificationMessage |
originalMessage |
|
string |
language |
|
int |
recipientPreferredTimeZoneId |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<PushNotificationMessage> |
|
Declaration
public Task<IEnumerable<string>> PNSHandlesAsync(NotificationPlatform platform, CancellationToken cancellationToken = default)
Parameters
Returns
PurgeOldDevicesAsync(TimeSpan, CancellationToken)
Will delete all registerred devices for the associate, with an handler update date older than current time - specified age
Declaration
public Task PurgeOldDevicesAsync(TimeSpan age, CancellationToken cancellationToken = default)
Parameters
Returns
RegisterDeviceAsync(DeviceInfo, CancellationToken)
Declaration
public Task RegisterDeviceAsync(DeviceInfo deviceInfo, CancellationToken cancellationToken = default)
Parameters
Returns
SendMessageAsync(IAsyncEnumerable<PushNotificationServiceRow>, PushNotificationMessage, bool, CancellationToken)
Declaration
public Task SendMessageAsync(IAsyncEnumerable<PushNotificationServiceRow> rows, PushNotificationMessage message, bool usePredefinedMessageValues, CancellationToken cancellationToken = default)
Parameters
Returns
SendMessageAsync(IEnumerable<int>, PushNotificationMessage, bool, bool, CancellationToken)
Sends a push notification message to associates that have devices added in the PushNotificationService table
Declaration
public Task SendMessageAsync(IEnumerable<int> associateIds, PushNotificationMessage message, bool usePredefinedMessageValues, bool overrideTagSettings, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
IEnumerable<int> |
associateIds |
Who should receive the message
|
PushNotificationMessage |
message |
The message to send
|
bool |
usePredefinedMessageValues |
If this is true, we will look up and replace the message title based on the NotificationMessageType. If no url is provided, a default value will be assigned
|
bool |
overrideTagSettings |
If true, ignore possible tag settings about disabling certain message types
|
CancellationToken |
cancellationToken |
|
Returns
SendMessageAsync(int, PushNotificationMessage, bool, CancellationToken)
Send a message to a single user
Declaration
public Task SendMessageAsync(int associateId, PushNotificationMessage message, bool overrideTagSettings, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
int |
associateId |
Who should receive the message
|
PushNotificationMessage |
message |
The message to send
|
bool |
overrideTagSettings |
If true, ignore possible tag settings about disabling certain message types
|
CancellationToken |
cancellationToken |
|
Returns
Declaration
public Task SetTagsAsync(int associateId, string tags, CancellationToken cancellationToken = default)
Parameters
Returns
Declaration
public Task SetTagsAsync(string deviceIdentifier, string tags, CancellationToken cancellationToken = default)
Parameters
Returns
UpdateSentNotificationCount(string, int, CancellationToken)
Declaration
public Task UpdateSentNotificationCount(string deviceIdentifier, int notificationCount, CancellationToken cancellationToken = default)
Parameters
Returns
Implements
Extension Methods