Immerse SDK
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Message Definition

Before a message can be sent, it must be defined. Without this definition, the server will not know how to handle the message and so it will be ignored. See below for the ways to define a message.

Messages settings foldout

Field Description
Name Identify the message (primarily for developer reference)
Message Type Unique identification for this message type. This is automatically generated when using an Object Reference definition.
Profile Who can send this message?
Space Owner: Only the owner of the session can send this message
Participant: Anyone can send this message
Is Persisted If the message should be saved and resent to connecting users.
Boardcast to Self If the message should be also sent to the sender for processing.

Manual Entry

This input method is used when you want to explicitly define the Message Type for your definition. You will likely want to define a constant or enum somewhere within your code to make this value easily accessible.

Object Reference

When using an object reference to create a message definition, the Message Type isn’t generated until the application is built. Therefore, when sending a message or registering your message handler for this type, you will need to reference that same object.

This way of defining a message is useful when creating modules intended for use across multiple projects, where you cannot guarantee a unique message type otherwise.

Catch Exceptions

The Catch Exceptions option catches all exceptions thrown by a message handler allowing the application to continue processing incoming messages. It is strongly recommended that this option is enabled for final application builds. Disabling this option can be helpful when trying to find the cause of an exception during development.