Beamable SDK
Public Member Functions | Static Public Attributes | List of all members
Core.Platform.SDK.Notification.NotificationService Class Reference
Inheritance diagram for Core.Platform.SDK.Notification.NotificationService:
Inheritance graph
[legend]
Collaboration diagram for Core.Platform.SDK.Notification.NotificationService:
Collaboration graph
[legend]

Public Member Functions

delegate void InGameNotificationCB (string notificationKey, string message)
 
void RegisterForNotifications (PlatformService platform)
 Register for remote and local notifications More...
 
void Subscribe (string name, Action< object > callback)
 Register a callback handler for push notifications. More...
 
void Unsubscribe (string name, Action< object > handler)
 
void Publish (string name, object payload)
 Trigger the callbacks for a given notification. More...
 
void ScheduleInGameNotification (string key, string message, TimeSpan timeFromNow, InGameNotificationCB callback)
 
void CancelInGameNotification (string key)
 
void RemoveAllInGameNotifications ()
 
void Update ()
 
void CreateNotificationChannel (string id, string name, string description)
 Create a notification channel. More...
 
void ScheduleLocalNotification (string channel, string key, int trackingId, string title, string message, TimeSpan timeFromNow, bool restrictTime, Dictionary< string, string > customData=null)
 Schedule a local notification. This will overwrite any previous notification with the same key that may exist. More...
 
void CancelLocalNotification (string key)
 Cancel a pending local notification that has not yet been shown. More...
 

Static Public Attributes

const int MaxLocalNotifications = 25
 

Member Function Documentation

◆ CancelInGameNotification()

void Core.Platform.SDK.Notification.NotificationService.CancelInGameNotification ( string  key)
inline

Cancel an in-game notification.

Parameters
keyan arbitrary identifier for this notification

◆ CancelLocalNotification()

void Core.Platform.SDK.Notification.NotificationService.CancelLocalNotification ( string  key)
inline

Cancel a pending local notification that has not yet been shown.

Parameters
keyString key identifying the notification.

◆ CreateNotificationChannel()

void Core.Platform.SDK.Notification.NotificationService.CreateNotificationChannel ( string  id,
string  name,
string  description 
)
inline

Create a notification channel.

Parameters
idIdentifier of the notification channel.
nameArbitrary identifier that can be used to cancel the notification.
descriptionArbitrary ID used for analytics.

◆ Publish()

void Core.Platform.SDK.Notification.NotificationService.Publish ( string  name,
object  payload 
)
inline

Trigger the callbacks for a given notification.

Parameters
nameThe event name to publish
payloadThe data to to make available to all subscribers

◆ RegisterForNotifications()

void Core.Platform.SDK.Notification.NotificationService.RegisterForNotifications ( PlatformService  platform)
inline

Register for remote and local notifications

◆ ScheduleInGameNotification()

void Core.Platform.SDK.Notification.NotificationService.ScheduleInGameNotification ( string  key,
string  message,
TimeSpan  timeFromNow,
InGameNotificationCB  callback 
)
inline

Schedule an in-game notification. If an existing notification is found, then it will be replaced. Use this method to schedule an notification 1971 seconds from now. Note that In game notifications don't persist after game restarts.

Parameters
keyan arbitrary identifier for this notification that is used for cancelling later
timeFromNowThe amount of time into the future to fire this notification

◆ ScheduleLocalNotification()

void Core.Platform.SDK.Notification.NotificationService.ScheduleLocalNotification ( string  channel,
string  key,
int  trackingId,
string  title,
string  message,
TimeSpan  timeFromNow,
bool  restrictTime,
Dictionary< string, string >  customData = null 
)
inline

Schedule a local notification. This will overwrite any previous notification with the same key that may exist.

Parameters
channelIdentifier of the notification channel.
keyArbitrary identifier that can be used to cancel the notification.
trackingIdArbitrary ID used for analytics.
titleThe title of the action button or slider.
messageThe message body text.
timeFromNowHow long before the notification should appear.
restrictTimeIf true the notification will be placed inside the restricted time window.
customDataOptional list of custom data to store in the notification for later use.

◆ Subscribe()

void Core.Platform.SDK.Notification.NotificationService.Subscribe ( string  name,
Action< object >  callback 
)
inline

Register a callback handler for push notifications.

Parameters
nameThe event name to receive a callback on
callbackThe callback to invoke when the event is received

The documentation for this class was generated from the following file: