Beamable SDK
Public Member Functions | Static Public Attributes | List of all members
Beamable.Api.Notification.NotificationService Class Reference

This type defines the Client main entry point for the Notifications feature. More...

Inheritance diagram for Beamable.Api.Notification.NotificationService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.Notification.NotificationService:
Collaboration graph
[legend]

Public Member Functions

delegate void InGameNotificationCB (string notificationKey, string message)
 
void RegisterForNotifications ()
 Register for remote and local notifications More...
 
void Subscribe< T > (string name, Action< T > callback)
 Register a callback handler for notifications. These callbacks will be triggered anytime an event with same name is sent to the Publish method. More...
 
void Subscribe (string name, Action< object > callback)
 Register a callback handler for push notifications. More...
 
void Unsubscribe (string name, Action< object > handler)
 Unregister a callback handler for a notification. More...
 
void Unsubscribe< T > (string name, Action< T > handler)
 Unregister a callback handler for a notification. More...
 
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
 

Detailed Description

This type defines the Client main entry point for the Notifications feature.

Related Links

img beamable-logo

Member Function Documentation

◆ CancelInGameNotification()

void Beamable.Api.Notification.NotificationService.CancelInGameNotification ( string  key)
inline

Cancel an in-game notification.

Parameters
keyan arbitrary identifier for this notification

◆ CancelLocalNotification()

void Beamable.Api.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 Beamable.Api.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.

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ Publish()

void Beamable.Api.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

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ RegisterForNotifications()

void Beamable.Api.Notification.NotificationService.RegisterForNotifications ( )
inline

Register for remote and local notifications

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ ScheduleInGameNotification()

void Beamable.Api.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 Beamable.Api.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.

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ Subscribe()

void Beamable.Api.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

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ Subscribe< T >()

void Beamable.Api.Notification.NotificationService.Subscribe< T > ( string  name,
Action< T >  callback 
)
inline

Register a callback handler for notifications. These callbacks will be triggered anytime an event with same name is sent to the Publish method.

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ Unsubscribe()

void Beamable.Api.Notification.NotificationService.Unsubscribe ( string  name,
Action< object >  handler 
)
inline

Unregister a callback handler for a notification.

Parameters
nameThe event name to remove a callback handler from.
handlerThe same instance of the callback that was registered with the Subscribe method.

Implements Beamable.Common.Api.Notifications.INotificationService.

◆ Unsubscribe< T >()

void Beamable.Api.Notification.NotificationService.Unsubscribe< T > ( string  name,
Action< T >  handler 
)
inline

Unregister a callback handler for a notification.

Implements Beamable.Common.Api.Notifications.INotificationService.


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