Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Api.Notifications.INotificationService Interface Reference
Inheritance diagram for Beamable.Common.Api.Notifications.INotificationService:
Inheritance graph
[legend]

Public Member Functions

void Subscribe (string name, Action< object > callback)
 Register a callback handler for notifications. Note that the object given to the callback may not be the exact type you expect. Instead, it may be an ArrayDict. Use the Subscribe<T> method to have the callback deliver an object of the desired type. These callbacks will be triggered anytime an event with same name is sent to the Publish method. More...
 
void Unsubscribe (string name, Action< object > handler)
 Unregister a callback handler for a notification. 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 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. Callbacks can be registered using the Subscribe method. More...
 
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 RegisterForNotifications ()
 Register for remote and local notifications More...
 

Member Function Documentation

◆ CreateNotificationChannel()

void Beamable.Common.Api.Notifications.INotificationService.CreateNotificationChannel ( string  id,
string  name,
string  description 
)

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.

Implemented in Beamable.Api.Notification.NotificationService.

◆ Publish()

void Beamable.Common.Api.Notifications.INotificationService.Publish ( string  name,
object  payload 
)

Trigger the callbacks for a given notification. Callbacks can be registered using the Subscribe method.

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

Implemented in Beamable.Api.Notification.NotificationService.

◆ RegisterForNotifications()

void Beamable.Common.Api.Notifications.INotificationService.RegisterForNotifications ( )

Register for remote and local notifications

Implemented in Beamable.Api.Notification.NotificationService.

◆ ScheduleLocalNotification()

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

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.

Implemented in Beamable.Api.Notification.NotificationService.

◆ Subscribe()

void Beamable.Common.Api.Notifications.INotificationService.Subscribe ( string  name,
Action< object >  callback 
)

Register a callback handler for notifications. Note that the object given to the callback may not be the exact type you expect. Instead, it may be an ArrayDict. Use the Subscribe<T> method to have the callback deliver an object of the desired type. These callbacks will be triggered anytime an event with same name is sent to the Publish method.

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

Implemented in Beamable.Api.Notification.NotificationService.

◆ Subscribe< T >()

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

Parameters
nameThe event name to receive a callback on
callbackThe callback to invoke when the event is received
Template Parameters
TThe type of argument that was sent with the original event. If a type of "string" is given, the inner event will assumed to have an inner "stringValue" field containing the raw string.

Implemented in Beamable.Api.Notification.NotificationService.

◆ Unsubscribe()

void Beamable.Common.Api.Notifications.INotificationService.Unsubscribe ( string  name,
Action< object >  handler 
)

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.

Implemented in Beamable.Api.Notification.NotificationService.

◆ Unsubscribe< T >()

void Beamable.Common.Api.Notifications.INotificationService.Unsubscribe< T > ( string  name,
Action< T >  handler 
)

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<T> method.
Template Parameters
T

Implemented in Beamable.Api.Notification.NotificationService.


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