Protocols
The following protocols are available globally.
- 
                  
                  The SINAudioController provides methods for controlling audio related functionality, e.g. enabling the speaker, muting the microphone, and playing sound files. Important Thread safety notes: All interaction should be done on main thread/main GCD queue.Playing Sound FilesThe audio controller provides a convenience method (startPlayingSoundFile:loop:) for playing sounds that are related to a call, such as ringtones and busy tones. - Example:
 id<SINAudioController> audio = [client audioController]; NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"ringtone" ofType:@"wav"]; NSError *error; [audio startPlayingSoundFile:soundPath loop:YES error:&error];Applications that prefer to use their own code for playing sounds are free to do so, but they should follow a few guidelines related to audio session categories and audio session activation/deactivation (see Sinch SDK User Guide for details). Sound File FormatThe sound file must be a mono (1 channel), 16-bit, uncompressed (PCM) .wav file with a sample rate of 8kHz, 16kHz, or 32kHz. See moreDeclarationObjective-C @protocol SINAudioController <NSObject>Swift protocol SINAudioController : NSObjectProtocol
- 
                  
                  The delegate of a SINAudioController object must adopt the SINAudioControllerDelegate protocol. The methods handle audio related state changes. See moreImportant Thread safety notes: Should be called on main thread/main GCD queue.DeclarationObjective-C @protocol SINAudioControllerDelegate <NSObject>Swift protocol SINAudioControllerDelegate : NSObjectProtocol
- 
                  
                  The SINCall represents a call. See moreImportant Thread safety notes: All interaction should be done on main thread/main GCD queue.DeclarationObjective-C @protocol SINCall <NSObject>Swift protocol SINCall : NSObjectProtocol
- 
                  
                  The delegate of a SINCall object must adopt the SINCallDelegate protocol. The required methods handle call state changes. Call State ProgressionFor a complete outgoing call, the delegate methods will be called in the following order: - callDidProgress:
- callDidEstablish:
- callDidEnd:
 For a complete incoming call, the delegate methods will be called in the following order, after the client delegate method [SINClientDelegate client:didReceiveIncomingCall:]has been called:- callDidEstablish:
- callDidEnd:- Important Thread safety notes: Should be called on main thread/main GCD queue.
 DeclarationObjective-C @protocol SINCallDelegate <NSObject>Swift protocol SINCallDelegate : NSObjectProtocol
- 
                  
                  SINCallClient 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];
 DeclarationObjective-C @protocol SINCallClient <NSObject>Swift protocol SINCallClient : NSObjectProtocol
- 
                  
                  The delegate of a SINCallClient object must adopt the SINCallClientDelegate protocol. See moreDeclarationObjective-C @protocol SINCallClientDelegate <NSObject>Swift protocol SINCallClientDelegate : NSObjectProtocol
- 
                  
                  The SINCallDetails holds metadata about a call (SINCall). See moreImportant Thread safety notes: All interaction should be done on main thread/main GCD queue.DeclarationObjective-C @protocol SINCallDetails <NSObject>Swift protocol SINCallDetails : NSObjectProtocol
- 
                  
                  SINCallNotificationResult is used to indicate the result of -[SINClient relayPushNotificationPayload:]when the Sinch-specific payload in the notification represents an incoming call.One example of a scenario where SINCallNotificationResult is when a user have been attempted to be reached, but not acted on the notification directly. In that case, the notification result object can indicate that the notification is too old ( isTimedOut), and also contains theremoteUserIdwhich can be used for display purposes.See moreImportant Thread safety notes: All interaction should be done on main thread/main GCD queue.DeclarationObjective-C @protocol SINCallNotificationResult <NSObject>Swift protocol SINCallNotificationResult : NSObjectProtocol
- 
                  
                  The SINClient is the Sinch SDK entry point. Important Thread safety notes: All interaction should be done on main thread/main GCD queue.It provides access to the feature classes in the Sinch SDK: SINCallClient and SINAudioController. It is also used to configure the user’s and device’s capabilities. User IdentificationThe user IDs that are used to identify users application specific. Important user IDs are restricted to the character set “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghjiklmnopqrstuvwxyz0123456789-_=”, and must be no longer than 255 bytes. - Example: - // Instantiate a client object using the client factory. NSError *error; id<SINClient> client = [Sinch clientWithApplicationKey:@"<APPLICATION KEY>" environmentHost:@"ocra.api.sinch.com" userId:@"<USERID>" error:&error]; // Enable push notifications [client enableManagedPushNotifications]; // Assign delegate. It is required to implement // -[SINClientDelegate client:requiresRegistrationCredentials:] // and provide a authorization token (JWT) to allow the User to register // and the client to successfully start. client.delegate = ... ; // Start the client [client start]; // Use SINCallClient to place and receive calls [client.callClient callUserWithId:...]
 DeclarationObjective-C @protocol SINClient <NSObject>Swift protocol SINClient : NSObjectProtocol
- 
                  
                  The delegate of a SINClient object must adopt the SINClientDelegate protocol. The required methods allows responding to client state changes (start and stop), and providing user registration credentials (JWT). See moreDeclarationObjective-C @protocol SINClientDelegate <NSObject>Swift protocol SINClientDelegate : NSObjectProtocol
- 
                  
                  Callback object to be used to proceed in user registration process when registration credentials for the user in question have been obtained. See moreDeclarationObjective-C @protocol SINClientRegistration <NSObject>Swift protocol SINClientRegistration : NSObjectProtocol
- 
                  
                  SINManagedPushDelegate See moreDeclarationObjective-C @protocol SINManagedPushDelegate <NSObject>Swift protocol SINManagedPushDelegate : NSObjectProtocol
- 
                  
                  SINNotificationResult is used to indicate the result of -[SINClient relayPushNotification:]and+[SINManagedPush queryPushNotificationPayload:].Important Thread safety notes: All interaction should be done on main thread/main GCD queue. - Example: 
 id<SINNotificationResult> result = [self.client relayPushNotification:payload]; if ([result isCall] && [result callResult].isTimedOut) { NSString* remoteUserId = [result callResult].remoteUserId; // Present UI indicating user missed the call. }It can be especially useful for scenarios which will not result in the SINClientDelegate receiving any callback for an incoming call as a result of calling the methods mentioned above. One such scenario is when a user have been attempted to be reached, but not acted on the notification directly. In that case, the notification result object can indicate that the notification is too old ( See moreisTimedOut), and also contains theremoteUserIdwhich can be used for display purposes.DeclarationObjective-C @protocol SINNotificationResult <NSObject>Swift protocol SINNotificationResult : NSObjectProtocol
- 
                  
                  The SINVideoController provides methods for controlling video related functionality. See moreImportant Thread safety notes: All interaction should be done on main thread/main GCD queue.DeclarationObjective-C @protocol SINVideoController <NSObject>Swift protocol SINVideoController : NSObjectProtocol
- 
                  
                  Video frame handler must adopt SINVideoFrameCallback protocol See moreDeclarationObjective-C @protocol SINVideoFrameCallback <NSObject>Swift protocol SINVideoFrameCallback : NSObjectProtocol
 Protocols  Reference
        Protocols  Reference