Sinch


@interface Sinch : NSObject

The Sinch class is used to instantiate a SINClient.

This is the starting point for an app that wishes to use the Sinch SDK.

To construct a SINClient, the required configuration parameters are:

  • Application Key
  • Environment host (default is ‘ocra.api.sinch.com’)
  • UserID

It is optional to specify:

  • CLI (Calling-Line Identifier / Caller-ID) that will be used for calls terminated to PSTN (Publicly Switched Telephone Network).

Basic factory methods

  • Instantiate a new client.

    See

    SINClient

    Declaration

    Objective-C

    + (id<SINClient>)clientWithApplicationKey:(NSString *)applicationKey
                              environmentHost:(NSString *)environmentHost
                                       userId:(NSString *)userId;

    Parameters

    applicationKey

    Application Key identifying the application.

    environmentHost

    Host for base URL for the Sinch RTC API environment to be used. E.g. ‘ocra.api.sinch.com’

    userId

    ID of the local user.

    Return Value

    The newly instantiated client.

Factory methods with support for CLI / PSTN

  • Instantiate a new client with a CLI (may be used for PSTN-terminated calls).

    See

    SINClient

    Declaration

    Objective-C

    + (id<SINClient>)clientWithApplicationKey:(NSString *)applicationKey
                              environmentHost:(NSString *)environmentHost
                                       userId:(NSString *)userId
                                          cli:(NSString *)cli;

    Parameters

    applicationKey

    Application key identifying the application.

    environmentHost

    Host for base URL for the Sinch RTC API environment to be used. E.g. ‘ocra.api.sinch.com’

    userId

    ID of the local user.

    cli

    Caller-ID when terminating calls to PSTN. Must be a valid phone number.

    Return Value

    The newly instantiated client.

Push Notifications

  • Instantiate a new SINManagedPush instance 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.

    Declaration

    Objective-C

    + (SINManagedPush *)managedPushWithAPSEnvironment:
        (SINAPSEnvironment)apsEnvironment;

    Parameters

    apsEnvironment

    Specification of which Apple Push Notification Service environment the application is bound to (via code signing and Provisioning Profile).

Miscellaneous

  • Set a log callback block.

    The Sinch SDK will emit all it’s logging by invoking the specified block.

    Important

    Only log messages with severity level SINLogSeverityWarn or higher to the console in release builds, to avoid flooding the device console with debugging messages.

    Declaration

    Objective-C

    + (void)setLogCallback:(SINLogCallback)block;

    Parameters

    block

    log 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, SINManagedPush etc.

    Declaration

    Objective-C

    + (void)setDataProtectionType:(NSFileProtectionType)type;

    Parameters

    type

    the data protection type applied to the files created by the Sinch SDK.

  • Declaration

    Objective-C

    + (NSString *)version;

    Return Value

    Sinch SDK version.