MultipeerAdvertisement

data class MultipeerAdvertisement(val handle: String, val displayName: String, val serviceType: String) : Tag

Tag for a peer discovered via Apple's MultipeerConnectivity framework.

Apple represents peers with MCPeerID objects whose lifetime is tied to the advertising peer's process. We can't surface those directly through Tag (it would leak ObjC into commonMain), so the underlying MCPeerID is held in a per-session map keyed by handle; callers pass the advertisement back to MultipeerPeerLinkFactory.join which performs the lookup.

Constructors

Link copied to clipboard
constructor(handle: String, displayName: String, serviceType: String)

Properties

Link copied to clipboard
open override val displayName: String

Human-readable name as broadcast by the advertising peer (matches its MCPeerID.displayName).

Link copied to clipboard

Stable opaque identifier for this peer within the current browse session. Treat it as an opaque token — its only valid use is round- tripping back to the MultipeerPeerLinkFactory that produced it.

Link copied to clipboard
open override val peerKey: String

The MC peer handle — stable within the current browse session.

Link copied to clipboard

MultipeerConnectivity service type string the peer advertised under (matches the serviceType passed to MultipeerPeerLinkFactory).