A sender or recipient of a message in a conversation.
Create a `Participant` by providing a display name, a handle that
uniquely identifies the participant, and a Boolean value that
indicates whether the participant is the user of this device. Common handles
are phone numbers or email addresses, but you can use any string that
uniquely identifies a participant within your app's user identity
system.
To enable the Suggested Actions to tailor the suggested actions to the person who
uses a device, make sure the `isUser` parameter of ``init(name:handle:isUser:)`` is `true` for
the participant that uses the device. Set `isUser` to `false` for other participants.
The following code snippet shows how an app can initialize a `Participant` who uses the current device
and a second participant who sends a message from their own device to the first participant's device:
```swift
// The participant who uses this device.
let user = SuggestedActionsMessage.Participant(
name: "Anne Johnson",
handle: "annejohnson1@icloud.com",
isUser: true
)
// A second participant, usually contact in the conversation.
let contact = SuggestedActionsMessage.Participant(
name: "Juan Chavez",
handle: "chavez4@icloud.com",
isUser: false
)
```
Creates a participant in a conversation.
- Parameters:
- name: The participant's display name, for example, Juan Chavez.
- handle: A unique identifier for the participant, like an
email address or phone number.
- isUser: A Boolean value that indicates whether the participant
is the user of this device. Set `isUser` to `true` for the
participant whose identity matches the user signed in to your
app on this device, and `false` for every other participant.