Functions
The following functions are available globally.
-
Method used to extract call information contained in raw push notification payload.
See also
See also
Declaration
Swift
public func queryPushNotificationPayload(_ payload: [AnyHashable : Any]) -> SinchNotificationResultParameters
payloadRemote notification payload which was transferred with an Apple Push Notification.
Return Value
Result of initial inspection of push notification.
-
Determine whether a push notification payload is carrying a Sinch payload.
Declaration
Swift
public func isSinchPushPayload(_ payload: [AnyHashable : Any]) -> BoolParameters
payloadPayload that was received in push notification
Return Value
true if payload is identified as Sinch, false otherwise
-
Instantiate a new client. The creation of the client may fail, as a result of input parameters being nil or not matching length criteria, or because of internal failure when creating application support directory. If any failure occurs, the method will throw.
Throws
if creation of the client fails
See also
Declaration
Swift
public func client(withApplicationKey key: String, environmentHost: String, userId: String) throws -> SinchClientParameters
keyApplication Key identifying the application
environmentHostHost for base URL for the Sinch RTC API environment to be used. E.g. ‘ocra.api.sinch.com’
userIdID of the local user
Return Value
The newly instantiated client.
-
Instantiate a new client with a CLI (may be used for PSTN-terminated calls). The creation of the client may fail, as a result of input parameters being nil or not matching length criteria, or because of internal failure when creating application support directory. If any failure occurs, the method will throw.
Throws
if creation of the client fails
See also
Declaration
Swift
public func client(withApplicationKey key: String, environmentHost: String, userId: String, cli: String) throws -> SinchClientParameters
keyApplication Key identifying the application
environmentHostHost for base URL for the Sinch RTC API environment to be used. E.g. ‘ocra.api.sinch.com’
userIdID of the local user
cliCaller-ID when terminating calls to PSTN. Must be a valid phone number.
Return Value
The newly instantiated client.
-
Instantiate a new
SinchManagedPushinstance to enable Push Notifications managed by the Sinch SDK and platform. When using managed push notifications, push notifications will be sent by the Sinch platform provided that Apple Push Notification Certificates for your application have been uploaded to Sinch.See also
SinchAPSEnvironment
Declaration
Swift
public func managedPush(forAPSEnvironment environment: APSEnvironment) -> SinchManagedPushParameters
environmentSpecification of which Apple Push Notification Service environment the application is bound to (via code signing and Provisioning Profile).
-
Set a log callback block.
The Sinch SDK will emit all it’s logging by invoking the specified block.
Caution: Only log messages with severity level
LogSeverity.warningor higher to the console in release builds, to avoid flooding the device console with debugging messages.Declaration
Swift
public func setLogCallback(_ callback: @escaping LogCallback)Parameters
callbacklog callback block. IMPORTANT: The block may be invoked on any thread / GCD queue.
-
Specify the data protection type (NSFileProtectionType) for the files created and used by the Sinch SDK. If not set specifically, the files will inherit the data protection level defined in your Application.
Method should be called before creation any instances of Sinch SDK classes, e.g. SINClient, SinchManagedPush etc.
Declaration
Swift
public func setDataProtectionType(_ type: FileProtectionType)Parameters
typethe data protection type applied to the files created by the Sinch SDK.
-
The Sinch SDK will emit all callbacks of SinchClientDelegate, SinchCallClientDelegate, SinchCallDelegate, SinchAudioControllerDelegate on the DispatchQueue specified with this method.
Note that SinchManagedPush delegate callbacks will still occur on any thread, because incoming VoIP pushes have to be reported to CallKit synchronously.
When not explicitly set, the callback queue defaults to the main queue.
- param queue: the DispatchQueue where callbacks will be invoked.
Declaration
Swift
public func setCallbackQueue(_ queue: DispatchQueue) -
Declaration
Swift
public func getCallbackQueue() -> DispatchQueueReturn Value
the callback queue set via SinchRTC.setCallbackQueue(), or the main queue if it hasn’t been set explicitly.
-
Returns the Sinch SDK version.
Declaration
Swift
public func version() -> String
Functions Reference