C# Class Sequencing.WeatherApp.Controllers.DaoLayer.DefaultPushNotificationService

Service which implements push notification logic
Inheritance: IPushNotificationService
Afficher le fichier Open project: SequencingDOTcom/Weather-My-Way-RTP-app Class Usage Examples

Méthodes publiques

Méthode Description
FetchUserDeviceTokens ( System.Int64 userId, DeviceType deviceType ) : List

Fetches user device tokens from database

IsTokenSubscribed ( string token ) : bool

Checks whether user devise is subscribed to get push notifications

IsUserSubscribed ( System.Int64 userId ) : bool

Checks whether user is subscribed to get push notifications

RefreshDeviceToken ( string oldId, string newId ) : void

Refreshes expired device token in DB

Send ( System.Int64 userId, DeviceType deviceType, string token, string message, ApplicationType appType ) : void

Sends push message to subscribed user device

Send ( System.Int64 userId, string message ) : void

Sends push message to all user devices

Subscribe ( string deviceToken, DeviceType deviceType, string accessToken, ApplicationType appType ) : void

Subscribe user to get push message

SubscribeDeviceToken ( string token, DeviceType deviceType, long userId, ApplicationType appType ) : void

Adds device token to database

Unsubscribe ( string token, long userId ) : void

Unsubscribe user from push message

Private Methods

Méthode Description
GetPushMessageSender ( DeviceType deviceType, ApplicationType appType ) : PushMessageSender

Determines device type

Method Details

FetchUserDeviceTokens() public méthode

Fetches user device tokens from database
public FetchUserDeviceTokens ( System.Int64 userId, DeviceType deviceType ) : List
userId System.Int64
deviceType DeviceType
Résultat List

IsTokenSubscribed() public méthode

Checks whether user devise is subscribed to get push notifications
public IsTokenSubscribed ( string token ) : bool
token string
Résultat bool

IsUserSubscribed() public méthode

Checks whether user is subscribed to get push notifications
public IsUserSubscribed ( System.Int64 userId ) : bool
userId System.Int64
Résultat bool

RefreshDeviceToken() public méthode

Refreshes expired device token in DB
public RefreshDeviceToken ( string oldId, string newId ) : void
oldId string
newId string
Résultat void

Send() public méthode

Sends push message to subscribed user device
public Send ( System.Int64 userId, DeviceType deviceType, string token, string message, ApplicationType appType ) : void
userId System.Int64
deviceType DeviceType
token string
message string
appType ApplicationType
Résultat void

Send() public méthode

Sends push message to all user devices
public Send ( System.Int64 userId, string message ) : void
userId System.Int64
message string
Résultat void

Subscribe() public méthode

Subscribe user to get push message
public Subscribe ( string deviceToken, DeviceType deviceType, string accessToken, ApplicationType appType ) : void
deviceToken string
deviceType DeviceType
accessToken string
appType ApplicationType
Résultat void

SubscribeDeviceToken() public méthode

Adds device token to database
public SubscribeDeviceToken ( string token, DeviceType deviceType, long userId, ApplicationType appType ) : void
token string
deviceType DeviceType
userId long
appType ApplicationType
Résultat void

Unsubscribe() public méthode

Unsubscribe user from push message
public Unsubscribe ( string token, long userId ) : void
token string
userId long
Résultat void