Contents

CustomMessageIdentifiable

A type that assigns a custom ID string to messages you send to other devices.

Declaration

protocol CustomMessageIdentifiable

Overview

Adopt this protocol in the custom types you use to send and receive messages during a group activity. You use a GroupSessionMessenger object to send custom messages between the same app on different devices. In addition to the message data, GroupSessionMessenger encodes your custom type name so that it can construct the correct type on those other devices. Use this protocol to identify your custom message types using an app-specific string instead of the type name.

Providing an app-specific string makes it possible to use different types to support messages. When the message data contains a custom message ID, GroupSessionMessenger looks for a type that conforms to the protocol with a messageIdentifier property that contains the matching string. It then creates that type and decodes the message data into it.

Topics

Type Properties

See Also

Session management