SINCallClient
Objective-C
@protocol SINCallClient <NSObject>
Swift
protocol SINCallClient : NSObjectProtocol
SINCallClient provides the entry point to the calling functionality of the Sinch SDK. A SINCallClient can be acquired via SINClient.
Example:
id<SINClient> sinchClient; [sinchClient start]; ... // Place outgoing call. id<SINCallClient> callClient = [sinchClient callClient]; id<SINCall> call = [callClient callUserWithId:@"<REMOTE USERID>"]; // Set the call delegate that handles all the call state changes call.delegate= ... ; // ... // Hang up the call [call hangup];
-
The object that acts as the delegate of the call client.
The delegate object handles call state change events and must adopt the SINCallClientDelegate protocol.
Declaration
Objective-C
@property (atomic, weak, readwrite) id<SINCallClientDelegate> delegate;
Swift
weak var delegate: (any SINCallClientDelegate)! { get set }
-
Calls the user with the given id and the given headers.
Declaration
Objective-C
- (id<SINCall>)callUserWithId:(NSString *)userId headers:(NSDictionary *)headers;
Swift
func callUser(withId userId: String!, headers: [AnyHashable : Any]!) -> (any SINCall)!
Parameters
userId
The application specific id of the user to call.
headers
NSString key-value pairs to pass with the call. The total size of header keys + values (when encoded with NSUTF8StringEncoding) must not exceed 1024 bytes. The call will fail immediately in case of invalid headers.
Return Value
SINCall
Outgoing call -
Make a video call to the user with the given id and the give headers
Declaration
Objective-C
- (id<SINCall>)callUserVideoWithId:(NSString *)userId headers:(NSDictionary *)headers;
Swift
func callUserVideo(withId userId: String!, headers: [AnyHashable : Any]!) -> (any SINCall)!
Parameters
userId
The application specific id of the user to call.
headers
NSString key-value pairs to pass with the call. The total size of header keys + values (when encoded with NSUTF8StringEncoding) must not exceed 1024 bytes. The call will fail immediately in case of invalid headers.
Return Value
SINCall
Outgoing call -
Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network).
Declaration
Objective-C
- (id<SINCall>)callPhoneNumber:(NSString *)phoneNumber;
Swift
func callPhoneNumber(_ phoneNumber: String!) -> (any SINCall)!
Parameters
phoneNumber
The phone number to call. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.
Return Value
SINCall
Outgoing call -
Calls a phone number and terminate the call to the PSTN-network (Publicly Switched Telephone Network).
Declaration
Objective-C
- (id<SINCall>)callPhoneNumber:(NSString *)phoneNumber headers:(NSDictionary *)headers;
Swift
func callPhoneNumber(_ phoneNumber: String!, headers: [AnyHashable : Any]!) -> (any SINCall)!
Parameters
phoneNumber
The phone number to call. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.
headers
NSString key-value pairs to pass with the call. The total size of header keys + values (when encoded with NSUTF8StringEncoding) must not exceed 1024 bytes. The call will fail immediately in case of invalid headers.
Return Value
SINCall
Outgoing call -
Make a SIP call to user with the given SIP Identity.
Declaration
Objective-C
- (id<SINCall>)callSIP:(NSString *)sipIdentity;
Swift
func callSIP(_ sipIdentity: String!) -> (any SINCall)!
Parameters
sipIdentity
The SIP identity string of the user to call, should be in the form of “user@domain”.
Return Value
SINCall
Outgoing call -
Make a SIP call to user with the given SIP Identity and adding the given headers.
Declaration
Objective-C
- (id<SINCall>)callSIP:(NSString *)sipIdentity headers:(NSDictionary *)headers;
Swift
func callSIP(_ sipIdentity: String!, headers: [AnyHashable : Any]!) -> (any SINCall)!
Parameters
sipIdentity
The SIP identity string of the user to call, should be in the form of “user@domain”.
headers
NSString key-value pairs to pass with the call. The total size of header keys + values (when encoded with NSUTF8StringEncoding) must not exceed 1024 bytes. The call will fail immediately in case of invalid headers.
Return Value
SINCall
Outgoing call -
Calls the conference with the given id.
Declaration
Objective-C
- (id<SINCall>)callConferenceWithId:(NSString *)conferenceId;
Swift
func callConference(withId conferenceId: String!) -> (any SINCall)!
Parameters
conferenceId
The application specific id of the conference to call. It must not exceed 64 characters, or the call will fail immediately.
Return Value
SINCall
Outgoing call -
Calls the conference with the given id and the given headers.
Declaration
Objective-C
- (id<SINCall>)callConferenceWithId:(NSString *)conferenceId headers:(NSDictionary *)headers;
Swift
func callConference(withId conferenceId: String!, headers: [AnyHashable : Any]!) -> (any SINCall)!
Parameters
conferenceId
The application specific id of the conference to call. It must not exceed 64 characters, or the call will fail immediately.
headers
NSString key-value pairs to pass with the call. The total size of header keys + values (when encoded with NSUTF8StringEncoding) must not exceed 1024 bytes. The call will fail immediately in case of invalid headers.
Return Value
SINCall
Outgoing call -
This API is introduced to support CallKit integration. Invoke this method to notify the Sinch SDK that the App has received the didActivateAudioSession callback from CXProviderDelegate. When CallKit is integrated in the App and an incoming call is received in the background, this method has to be invoked for the Sinch SDK to start the media for the call.
Declaration
Objective-C
- (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession;
Swift
func provider(_ provider: CXProvider!, didActivate audioSession: AVAudioSession!)
Parameters
audioSession
The audioSession from the didActivateAudioSession callback of CXProviderDelegate.
-
This API is introduced to support CallKit integration. Invoke this method to notify the Sinch SDK that the App has received the didDeactivateAudioSession callback from CXProviderDelegate. When CallKit is integrated in the App, this method has to be invoked to pass the didDeactivateAudioSession event from CallKit to the Sinch SDK for correct audio session management.
Declaration
Objective-C
- (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession;
Swift
func provider(_ provider: CXProvider!, didDeactivate audioSession: AVAudioSession!)
Parameters
audioSession
The audioSession from the didActivateAudioSession callback of CXProviderDelegate.
-
Sets the WebRTC configuration for every call created by SINCallClient. This method must be invoked before initiating any outgoing call or relying the push payload to ensure the configuration is applied.
Declaration
Objective-C
- (void)setWebRtcCallConfiguration: (SINWebRtcCallConfiguration *)webRtcCallConfiguration;
Swift
func setWebRtcCallConfiguration(_ webRtcCallConfiguration: SINWebRtcCallConfiguration!)
Parameters
webRtcCallConfiguration
The configuration to be used for WebRTC calls.