Skip to main content
Version: 10.8.x

NotificationCenter Class

Public Member Functions

bool HandlerSetHasObserver (NotificationHandler handler, string notificationName)
 Determines if a specific handler has already been registered to a notification. More...
 
void AddObserver (NotificationHandler handler, string notificationName)
 Registers a handler to a notification. More...
 
void RemoveObserver (NotificationHandler handler, string notificationName)
 Unregisters a handler from a notification. More...
 
void GetStringAndArgFromJson (string message, out string name, out string arg)
 Gets the string and argument values from the message json payload of format: {"name": "name_val", "arg": {"arg_json_val"}. More...
 

Properties

static NotificationCenter Instance [get]
 

Member Function Documentation

◆ AddObserver()

void BFGSDK.NotificationCenter.AddObserver (NotificationHandler handler,
string notificationName 
)
inline
Registers a handler to a notification.
Parameters
handlerThe function that will be triggered when the notification arrives.
notificationNameThe name of the notification to listen for.

◆ GetStringAndArgFromJson()

void BFGSDK.NotificationCenter.GetStringAndArgFromJson (string message,
out string name,
out string arg 
)
inline
Gets the string and argument values from the message json payload of format: {"name": "name_val", "arg": {"arg_json_val"}.
Parameters
messageMessage.
nameName.
argArgument.

◆ HandlerSetHasObserver()

bool BFGSDK.NotificationCenter.HandlerSetHasObserver (NotificationHandler handler,
string notificationName 
)
inline
Determines if a specific handler has already been registered to a notification.
Parameters
handlerThe function that was registered to be triggered when the notification arrived.
notificationNameThe name of the notification to listen for.
Returns
true If the handler is already registered, false otherwise.

◆ RemoveObserver()

void BFGSDK.NotificationCenter.RemoveObserver (NotificationHandler handler,
string notificationName 
)
inline
Unregisters a handler from a notification.
Parameters
handlerThe function that was registered to be triggered when the notification arrived.
notificationNameThe name of the notification to listen for.