PTPushResult
An object that represents a push result.
Declaration
class PTPushResultMentioned in
Overview
When an app receives an Apple Push Notification service payload, return a PTPushResult object as part of the delegate method. Use activeRemoteParticipant(_:) to show the latest participant information in the system user interface. Create a push result with leaveChannel to remove a user from the channel.
func incomingPushResult(channelManager: PTChannelManager,
channelUUID: UUID,
pushPayload: [String: Any]) -> PTPushResult {
guard let activeSpeaker = pushPayload["activeSpeaker"] as? String else {
// Report that there's no active speaker, so leave the channel.
return .leaveChannel
}
let activeSpeakerImage = // Get the cached image for the active speaker.
let participant = PTParticipant(name: activeSpeaker,
image: activeSpeakerImage)
// Report the active participant information to the system.
return .activeRemoteParticipant(participant)
}