Call start message
In 1-to-1 calls, a caller and a callee can send a limited size of message to each other during the call setup process. This message is called a call start message.
Supported call type | Supported SDK version |
---|---|
1-to-1 call | All versions |
A call start message is functionally equivalent to "Call Init data" available in PlanetKit 5.0.x or lower. Only the name of the feature has been changed since PlanetKit 5.1.
Sending a call start message
A caller and a callee can send a call start message at a different point in time during the call setup process.
To learn more about the call setup flow, see 1-to-1 call flow.
Caller side
A caller can send a call start message when making a call.
To send a call start message on the caller side, create a PlanetKitCallStartMessage
, set the PlanetKitCallStartMessage
in a PlanetKitCallParam
, and pass the PlanetKitCallParam
when calling makeCall()
.
let callStartMessage = PlanetKitCallStartMessage(data: "Call start message from a caller")
let param = PlanetKitCallParam(myUserId: myUserId, peerUserId: peerUserId, delegate: delegate, accessToken: accessToken)
param.startMessage = callStartMessage
let result = PlanetKitManager.shared.makeCall(param: param)
The message is delivered to the callee in the didVerify
callback.
Callee side
A callee can send a call start message when accepting a call.
To send a call start message on the callee side, create a PlanetKitCallStartMessage
and pass the PlanetKitCallStartMessage
when calling acceptCall()
.
let callStartMessage = PlanetKitCallStartMessage(data: "Call start message from a callee")
// Get the verified call instance "call" from the result of verifyCall()
call?.acceptCall(startMessage: callStartMessage, useResponderPreparation: false)
The message is delivered to the caller in the didConnect
callback.
Size limitation
The maximum size of a call start message is 200 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 call start message function are as follows.