Classes
The following classes are available globally.
-
The SinchAudioController provides methods for controlling audio related functionality, e.g. enabling the speaker, muting the microphone, and playing sound files.
Playing Sound Files
The audio controller provides a convenience method (startPlayingSoundFile:looping:) for playing sounds that are related to a call, such as ring tones and busy tones.
Example
let audio = client.audioController let soundPath = Bundle.main.path(forResource: "ringtone", ofType: "wav") do { try audio.startPlayingSoundFile(withPath:soundPath, looping:true) } catch { ... }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 Format
The sound file must be a mono (1 channel), 16-bit, uncompressed (PCM) .wav file with a sample rate of 8kHz, 16kHz, or 32kHz.
See moreDeclaration
Swift
public final class SinchAudioController -
The SinchCall represents a call.
See moreDeclaration
Swift
public final class SinchCall -
SinchCallClient provides the entry point to the calling functionality of the Sinch SDK. A SinchCallClient can be acquired via SinchClient.
Example
See morevar sinchClient: SinchClient sinchClient.start() ... // Place outgoing call. let callClient = sinchClient.callClient let result = callClient.callUser(withId:"<REMOTE USERID>") switch result { case let .success(call): // NOTE: Mediator is the only delegate of the call and will do the fanout of events call.delegate = self .... // Hang up the call call.hangup() case let .failure(error): print("Unable to make a call: \(error.localizedDescription)") }Declaration
Swift
public final class SinchCallClient -
The SinchClient is the Sinch SDK entry point.
It provides access to the feature classes in the Sinch SDK: SinchCallClient and SinchAudioController and etc. It is also used to configure the user’s and device’s capabilities.
### User Identification
The user IDs that are used to identify users application specific.
Important
user IDs are restricted to the characters in “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghjiklmnopqrstuvwxyz0123456789-_=”, and must be no longer than 255 bytes.### Example:
See more// Instantiate a client object using the client factory. let client = client(withApplicationKey: "<APPLICATION KEY>", environmentHost: "ocra.api.sinch.com", userId: "<USERID>") client.delegate = self // Enable push notifications client.enableManagedPushNotifications() // Start the client client.start() // Use SinchCallClient to place and receive calls client.callClient.callUser(withId:...)Declaration
Swift
public final class SinchClient -
Callback object to be used to proceed in user registration process when registration credentials for the user in question have been obtained.
See moreDeclaration
Swift
public final class SinchClientRegistration -
SinchManagedPush is a helper class to manage push notification credentials for VoIP Push Notifications.
SinchManagedPush acts as a facade for registering for device token for VoIP notifications, and can also automatically register any received push credentials to any active SinchClient.
SinchManagedPush simplifies scenarios such as when receiving a device token occur before creating a SinchClient. In such a case, SinchManagedPush can automatically register the device token when the SinchClient is created and started.
### Example
See morefunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { self.push = SinchRTC.managedPush(forAPSEnvironment: SinchRTC.APSEnvironment.development) self.push.delegate = self self.push.setDesiredPushType(SinchManagedPush.TypeVoIP) ... return true }Declaration
Swift
public final class SinchManagedPush -
The SinchAudioController provides methods for controlling audio related functionality
See moreDeclaration
Swift
public final class SinchVideoController : Synchronized -
This class contains the WebRTC connected configuration for Sinch calls.
See moreDeclaration
Swift
public class SinchWebRtcCallConfiguration -
Undocumented
See moreDeclaration
Swift
public class SynchronizedNSObject : NSObject -
Undocumented
See moreDeclaration
Swift
public class Synchronized
Classes Reference