<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/CustomMessageIdentifiable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities25CustomMessageIdentifiableP"
  },
  "title" : "CustomMessageIdentifiable"
}
-->

# CustomMessageIdentifiable

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

```
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`](/documentation/GroupActivities/GroupSessionMessenger) object to send
custom messages between the same app on different devices. In addition to the
message data, [`GroupSessionMessenger`](/documentation/GroupActivities/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`](/documentation/GroupActivities/GroupSessionMessenger) looks for a type that conforms to the protocol with
a [`messageIdentifier`](/documentation/GroupActivities/CustomMessageIdentifiable/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)