CustomMessageIdentifiable
protocol · iOS 15.0+ · SDK 27.1
protocol CustomMessageIdentifiableA type that assigns a custom ID string to messages you send to other devices. 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. - Note: Custom types that adopt this protocol must also adopt the <doc://com.apple.documentation/documentation/swift/codable> protocol.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.