Browse SDKs · iOS
Platform
SDKsiOSEnterprise

Accept a call

Accept a call invitation with the OpenIM iOS SDK.

Copy

Accept an incoming audio or video call invitation using signalingAccept:onSuccess:onFailure:, passing the exact OIMSignalingInfo received from the incoming invitation event.

Parameters

ParameterTypeRequiredDescription
signalingInfoOIMSignalingInfo *YesThe complete signaling information object delivered by the onReceiveNewInvitation: callback.

Code example

[[OIMManager manager] signalingAccept:signalingInfo
                            onSuccess:^(OIMInvitationResultInfo * _Nullable credentials) {
    if (credentials != nil) {
        [self joinMediaRoom:credentials];
    }
}
                            onFailure:^(NSInteger code, NSString * _Nullable message) {
    [self showCallError:code message:message ?: @"Failed to accept invitation"];
}];

Pass the unaltered OIMSignalingInfo instance received from the incoming event; never synthesize a new object or modify roomID.

Return value

The onSuccess callback returns an OIMInvitationResultInfo instance containing the call roomID, authentication token, and streaming liveURL. Join the RTC media room only after receiving these valid credentials.

State changes after the call

  • Local state merge: Merge call state by roomID and correlate participant states with userID.
  • Remote event notification: The caller and connected participants receive the acceptance notification via onInviteeAccepted: in OIMSignalingListener (see Handle call events).
  • Multi-device sync: Other devices logged in under the same account receive onInviteeAcceptedByOtherDevice: to synchronize UI state.