- RevueSDK
- FriendManager
- sendInvitation(friendId:message:)
Instance Method
sendInvitation(friendId:message:)
送出通話邀請給朋友
@MainActor func sendInvitation(friendId: String, message: String? = nil) throwsParameters
- friendId
對方好友 ID(Base58 字串)
- message
撥號時帶的 free-form opaque string(UTF-8 byte 上限 256,由 SDK 不檢查 / native 把關)
Discussion
觸發
RevueDelegate.didSendInvitation(friend:, message:)(撥打方視角)對方端會收到
RevueDelegate.didReceiveInvitation(message:)對方接受邀請 → 雙邊 fire
RoomDelegate.participantDidConnect, RemoteParticipant 才會建立並加入Room.shared.remoteParticipants對方拒絕 / 超時 / 網路中斷 → fire
RevueDelegate.didEndInvitation(reason:)
設計哲學:撥號階段不協商媒體能力(audio/video bitrate 永遠預留 audio=48 / video=3000 kbps)。 「實際是否傳送音視訊」由通話建立後的 LocalParticipant.publish* / sendVideoFrame 控制。 message 為 free-form opaque string、SDK 不解析;上層(業務 App)可自由約定協定 (例:用 "video" / "audio" 標示來電類型,或塞 JSON envelope)。
Throws
FriendCallError(見該型別的對照表)。 常見:.alreadyInCall(-28) /.friendNotReachable(-20) /.noDirectPath(-26) /.messageTooLong(-30) /.invalidArgument(-2)