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

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

Public Methods

Method 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

Method Description
GetPushMessageSender ( DeviceType deviceType, ApplicationType appType ) : PushMessageSender

Determines device type

Method Details

FetchUserDeviceTokens() public method

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

IsTokenSubscribed() public method

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

IsUserSubscribed() public method

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

RefreshDeviceToken() public method

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

Send() public method

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
return void

Send() public method

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

Subscribe() public method

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
return void

SubscribeDeviceToken() public method

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

Unsubscribe() public method

Unsubscribe user from push message
public Unsubscribe ( string token, long userId ) : void
token string
userId long
return void