기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Vivox Unity SDK

Vivox Unity SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Vivox
​
​
Vivox Unity SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
    • Set up your project
    • Create voice and text channels
    • Messaging
      • Channel messages
      • Message metadata
      • Chat history
      • Edit and delete messages
      • Directed messages
      • Offline direct messages
      • Anti-flooding
      • Large text channel setting
      • Retrieve Conversations list
      • Set Chat Markers
    • Player management
    • Device management
    • Audio management
    • Mobile development
    • Text-to-speech
    • Speech-to-text
    • Real-time recording
    • Server-side-recording
    • Troubleshooting
  • Tutorials
  • Reference
  1. Vivox Unity SDK 기술 자료
  2. Vivox Unity 개발자 가이드

Message metadata

Attach metadata to Vivox messages for additional context.
읽는 시간 2분
최근 업데이트: 8달 전

Send and receive additional information between players by attaching metadata to Vivox messages. This metadata can enhance player communication and support gameplay features..
Send information such as display names, a player’s local mute state, game data and more by adding metadata to messages. The metadata doesn't alter the original message content but provides context or instructions to the recipient or the game logic. Attach the metadata by using
MessageOptions.Metadata
; once received, retrieve the metadata with
VivoxMessage.Metadata
.
참고
Vivox is unable to send empty messages. To attach metadata, you must send a non-empty text message.
The following code sample is an example of sending a message with JSON metadata that communicates the user’s local mute state:
using UnityEngine;using Unity.Services.Vivox;[System.Serializable]public class MetadataInfo{ public string Type;}[System.Serializable]public class PlayerMuteInfoMetadata{ public string Type = "PlayerMuteInfo"; public string PlayerId; public bool LocallyMuted;}public async void MutePlayerLocally(VivoxParticipant participant){ // ... (player mute logic) // If it was a self-mute, the local user's input device would be muted. if (participant.IsSelf) { // Send a message with metadata to the channel communicating the local player's updated input device mute state to other participants. var messageOptions = new MessageOptions { Metadata = JsonUtility.ToJson(new PlayerMuteInfoMetadata { PlayerId = VivoxService.Instance.SignedInPlayerId, LocallyMuted = VivoxService.Instance.IsInputDeviceMuted }) }; await VivoxService.Instance.SendChannelTextMessageAsync(participant.ChannelName, "Metadata", messageOptions); }}
The following code sample is an example of parsing a message with JSON metadata:
VivoxService.Instance.ChannelMessageReceived += OnChannelMessageReceived;// In your channel message received handler:void OnChannelMessageReceived(VivoxMessage message){ // You can now parse or use the metadata that was attached when sending the message. if (!string.IsNullOrEmpty(message.Metadata)) { // Parse JSON metadata. var metadataType = JsonUtility.FromJson<MetadataInfo>(message.Metadata).Type; switch (metadataType) { case "PlayerMuteInfo": var playerInfo = JsonUtility.FromJson<PlayerMuteInfoMetadata>(message.Metadata); // Handle updating player info in UI. break; default: break; } }}
참고
The size limit for attached metadata is 65,536 bytes (64 KiB).

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.


    이 페이지의 문제 보고