App server data
Applications can share application data between an app client and the app server when making a 1-to-1 call or joining a group call (conference). App server data is name of the application data delivered from an app client to the app server.
Supported call type | Supported SDK version |
---|---|
1-to-1 call, group call | All versions |
- App server data is functionally equivalent to "Service ticket ID" available in PlanetKit 5.0.x or lower. Only the name of the feature has been changed since PlanetKit 5.1.
- In server callbacks, the
stid
parameter previously used for delivering the service ticket ID has been deprecated. Instead, theapp_svr_data
parameter delivers the app server data in server callbacks.
Sending app server data
The following sections describe how to send app server data based on the call type.
1-to-1 call
In 1-to-1 calls, only the caller can send app server data.
To send app server data in a 1-to-1 call, set the app server data in a PlanetKitCallParam
, and pass the PlanetKitCallParam
when calling makeCall()
.
let appServerData = "App server data for a 1-to-1 call"
let param = PlanetKitCallParam(myUserId: myUserId, peerUserId: peerUserId, delegate: delegate, accessToken: accessToken)
param.appServerData = appServerData
let result = PlanetKitManager.shared.makeCall(param: param)
The app server data is delivered in the app_svr_data
parameter of Notify and 1-to-1 Call Event server callbacks.
Group call
In group calls, all participants are eligible to send app server data.
To send app server data in a group call, set the app server data in a PlanetKitConferenceParam
, and pass the PlanetKitConferenceParam
when calling joinConference()
.
let appServerData = "App server data for a group call"
let param = PlanetKitConferenceParam(myUserId: myUserId, roomId: roomId, roomServiceId: roomServiceId, delegate: delegate, accessToken: accessToken)
param.appServerData = appServerData
let result = PlanetKitManager.shared.joinConference(param: param)
The app server data is delivered in the app_svr_data
parameter of the Group Call Event server callback.
Size limitation
The maximum size of app server data is 4096 bytes including the null termination character.
Comparison of a call start message and app server data
A call start message and app server data have the following differences:
Source and destination | Supported call type | |
---|---|---|
Call start message | App client of a caller → App client of a callee App client of a callee → App client of a caller | Only 1-to-1 call |
App server data | App client of a caller or participant → App server | 1-to-1 call, group call (conference) |
Related API
APIs related to the app server data function are as follows.