文档

​
​

Development

User Acquisition

Monetization

工业

Vivox Core SDK

Vivox Core SDK

此页面不支持所选语言。
Vivox
​
​
Vivox Core SDK
  • Overview
  • Before you begin
  • Get started
  • Release notes
  • Developer Guide
  • Reference
    • Access Token Developer Guide
      • Access token terminology
      • Requests that require access tokens
      • Access token identifiers
      • Access token format
      • Access token examples
      • Generate a token on the client
      • Generate a token on a secure server
      • Key update API
      • Override development key generation
      • Access token error codes
    • Server to Server Web API Reference Guide
    • Core API Reference Manual
    • Third-party license information
  • Privacy overview
  1. Vivox Core SDK documentation

Generate a token on the client

Generate Vivox Access Tokens on the client.
阅读时间2 分钟
最后更新于 8 个月前

注意
Use the following access token generation methods during initial development and prototyping. Do not include this method of generation in production builds of your game. Allowing token generation on the client during production is both a security risk and can cause unexpected token expiration errors for your users.
To generate your access token, call
vx_debug_generate_token()
with the following parameters:
  • The issuer
  • The expiration time in epoch seconds since January 1, 1970 UTC
  • The action (for example, "mute")
  • A serial number (a simple static incrementing counter is adequate - this allows for the generation of more than one request in the same second for the same set of claims)
  • An optional subject (the target for kick and mute actions, null otherwise)
  • The from URI (always the signing in or signed in user URI - required for all actions)
  • The to URI (null for the login action, and the channel URI for join, kick, and mute)
  • A pointer to a buffer holding the token signing key
  • The length of the token signing key
The following examples display access tokens for login, join, join_muted, kick, and mute, respectively:
static long long serialNumber = 0;// Loginrequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "login", serialNumber++, NULL, "sip:.issuer.me.@mt1s.vivox.com", NULL, (const unsigned char *)key, (int)strlen(key));// Joinrequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "join", serialNumber++, NULL, "sip:.issuer.me.@mt1s.vivox.com", "sip:confctl-g-issuer.lobby@mt1s.vivox.com", (const unsigned char *)key, (int)strlen(key));// Join Mutedrequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "join_muted", serialNumber++, NULL, "sip:.issuer.me.@mt1s.vivox.com", "sip:confctl-g-issuer.lobby@mt1s.vivox.com", (const unsigned char *)key, (int)strlen(key));// Kickrequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "kick", serialNumber++, "sip:.issuer.them.@mt1s.vivox.com", "sip:.issuer.me.@mt1s.vivox.com", "sip:confctl-g-issuer.lobby@mt1s.vivox.com", (const unsigned char *)key, (int)strlen(key));// Muterequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "mute", serialNumber++, "sip:.issuer.them.@mt1s.vivox.com", "sip:.issuer.me.@mt1s.vivox.com", "sip:confctl-g-issuer.lobby@mt1s.vivox.com", (const unsigned char *)key, (int)strlen(key));// Transcriptionrequest->access_token = vx_debug_generate_token("issuer", time(NULL) + 120, "trxn", serialNumber++, NULL, "sip:.issuer.me.@mt1s.vivox.com", "sip:confctl-g-issuer.lobby@mt1s.vivox.com", (const unsigned char *)key, (int)strlen(key));

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。


    报告此页面的问题