- RevueSDK
- RoomDelegate
- room(_:participant:didReceiveMessage:)
Instance Method
room(_:participant:didReceiveMessage:)
收到 Room 內參與者訊息
func room(_ room: Room, participant: RemoteParticipant, didReceiveMessage message: String)Discussion
由 LocalParticipant.publish(message:to:) 送達。觸發條件:
對方透過 Room 層 API 送訊息
envelope type == “msg” 且格式合法
delta(now - ts)<= 10 秒
對方 friendId 仍在 Room.remoteParticipants 內
收不到訊息的常見原因:
對方用
FriendManager.sendMessage送 → 會觸發RevueDelegate.didReceiveMessage訊息延遲超過 10 秒 → SDK 靜默丟棄
對方已不在 Room → SDK 靜默丟棄