API reference
API reference
Select your platform
No SDKs available
No versions available

Callback Class

This class represents a callback function that can be used to handle messages from the platform. It provides a way to register and execute callback functions for specific message types (Message.MessageType), allowing developers to customize the handling of incoming messages.

Object Data for package-static-func

This method sets the callback function for a specific notification message type. It takes two parameters: the type of notification message to set the callback for, and the callback function itself. If the provided callback is null, it throws an exception. It stores the callback function in a dictionary, using the notification message type as the key. If the notification message type is Notification_GroupPresence_JoinIntentReceived, it flushes the join intent notification queue by calling FlushJoinIntentNotificationQueue().
This method sets the callback function for a specific notification message type. It takes two parameters: the type of notification message to set the callback for, and the callback function itself. If the provided callback is null, it throws an exception. It stores the callback function in a dictionary, using the notification message type as the key.
This method adds a request to the mapping of callbacks. It takes one parameter: the request to be added. If the request ID is 0, it means an early out error happened in the C SDK and the request is not added to the mapping. An error message is logged in this case.
This method runs the callbacks for all pending messages. It repeatedly pops a message from the message queue using Platform.Message.PopMessage() and handles it until the queue is empty.
This method runs a limited number of callbacks for pending messages. It pops a message from the message queue using Platform.Message.PopMessage() and handles it up to the specified limit.
This method is called when the application quits. It clears out all outstanding callbacks by clearing the request IDs to requests and notification callbacks dictionaries.
This method handles a message by executing the associated callback function. It checks if a message callback has been set for the request ID, and if so, it calls the request.HandleMessage(msg) method on the corresponding request object. If no callback is registered for the request ID, it checks if there is a callback handler registered for the message type and calls the callbackHolder.HandleMessage(msg) method on it. If there is no callback handler registered, it checks if the message is a Join Intent notification and queues it up for processing.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon