SINCallClient
Objective-C
@protocol SINCallClient <NSObject>Swift
protocol SINCallClient : NSObjectProtocolSINCallClient provides the entry point to the calling functionality of the Sinch SDK. A SINCallClient can be acquired via SINClient.
Important
Thread safety notes: All interaction should be done on main thread/main GCD queue.
- 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. DeclarationObjective-C @property (nonatomic, weak, readwrite) id<SINCallClientDelegate> delegate;Swift weak var delegate: SINCallClientDelegate! { get set }
- 
                  
                  Calls the user with the given id and the given headers. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callUserWithId:(NSString *)userId headers:(NSDictionary *)headers;ParametersuserIdThe application specific id of the user to call. headersNSString 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 ValueSINCallOutgoing call
- 
                  
                  Make a video call to the user with the given id Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callUserVideoWithId:(NSString *)userId;ParametersuserIdThe application specific id of the user to call. Return ValueSINCallOutgoing call
- 
                  
                  Make a video call to the user with the given id and the give headers Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callUserVideoWithId:(NSString *)userId headers:(NSDictionary *)headers;ParametersuserIdThe application specific id of the user to call. headersNSString 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 ValueSINCallOutgoing call
- 
                  
                  Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network). Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callPhoneNumber:(NSString *)phoneNumber;ParametersphoneNumberThe 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 ValueSINCallOutgoing call
- 
                  
                  Calls a phone number and terminate the call to the PSTN-network (Publicly Switched Telephone Network). Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callPhoneNumber:(NSString *)phoneNumber headers:(NSDictionary *)headers;ParametersphoneNumberThe 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. headersNSString 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 ValueSINCallOutgoing call
- 
                  
                  Make a SIP call to user with the given SIP Identity. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callSIP:(NSString *)sipIdentity;ParameterssipIdentityThe SIP identity string of the user to call, should be in the form of “user@domain”. Return ValueSINCallOutgoing call
- 
                  
                  Make a SIP call to user with the given SIP Identity and adding the given headers. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callSIP:(NSString *)sipIdentity headers:(NSDictionary *)headers;ParameterssipIdentityThe SIP identity string of the user to call, should be in the form of “user@domain”. headersNSString 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 ValueSINCallOutgoing call
- 
                  
                  Calls the conference with the given id. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callConferenceWithId:(NSString *)conferenceId;ParametersconferenceIdThe application specific id of the conference to call. It must not exceed 64 characters, or the call will fail immediately. Return ValueSINCallOutgoing call
- 
                  
                  Calls the conference with the given id and the given headers. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (id<SINCall>)callConferenceWithId:(NSString *)conferenceId headers:(NSDictionary *)headers;ParametersconferenceIdThe application specific id of the conference to call. It must not exceed 64 characters, or the call will fail immediately. headersNSString 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 ValueSINCallOutgoing 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. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession;Swift func provider(_ provider: CXProvider!, didActivate audioSession: AVAudioSession!)ParametersaudioSessionThe 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. Important Thread safety notes: Should be called on main thread/main GCD queue. DeclarationObjective-C - (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession;Swift func provider(_ provider: CXProvider!, didDeactivate audioSession: AVAudioSession!)ParametersaudioSessionThe audioSession from the didActivateAudioSession callback of CXProviderDelegate. 
 SINCallClient Protocol Reference
        SINCallClient Protocol Reference