SDK lifecycle

Initialization


Initializes Synerise SDK.

Note: This method needs to be called before any other method of Synerise SDK and only once during the application’s lifecycle.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

initialize(clientApiKey:)

Declaration

static func initialize(clientApiKey: String) -> Void

Parameters

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Client API Key

Return Value

There is no return value.

Examples

let clientApiKey = "YOUR_CLIENT_API_KEY"
Synerise.initialize(clientApiKey: clientApiKey)

Initialize with custom environment


Initializes Synerise SDK with custom environment settings.

Note: This method needs to be called before any other method of Synerise SDK and only once during the application’s lifecycle.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

initialize(clientApiKey:baseUrl:)

Declaration

static func initialize(clientApiKey: String, baseUrl: String?) -> Void

Parameters

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Client API Key
baseUrl String no - Synerise API custom environment base URL

Return Value

There is no return value.

Examples

let clientApiKey = "YOUR_CLIENT_API_KEY"
let apiBaseUrl = "YOUR_API_BASE_URL"
Synerise.initialize(clientApiKey: clientApiKey, baseUrl: apiBaseUrl)

Change Client API Key dynamically


Changes Client API Key dynamically.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

changeApiKey(newApiKey)

Declaration

static func changeClientApiKey(_ clientApiKey: String) -> Void

Parameters

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Client API Key

Return Value

There is no return value.

Set up Host Application Type


Sets Synerise SDK host application type.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

setHostApplicationType(_ type: HostApplicationType)

Declaration

static func setHostApplicationType(_ type: HostApplicationType) -> Void

Parameters

Parameter Type Mandatory Default Description
type HostApplicationType yes - Specifies the type of host application

Return Value

There is no return value.

Set up Debug Mode


Enables/disables console logs from Synerise SDK.

WARNING: It is not recommended to use debug mode in release version of your application.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

setDebugModeEnabled(_ enabled:)

Declaration

static func setDebugModeEnabled(_: Bool) -> Void

Parameters

Parameter Type Mandatory Default Description
enabled Bool yes - Enables/disables console logs

Return Value

There is no return value.

Enable Crash Handling


Enables/Disables crash handling from Synerise SDK.

Declared In

SNRSynerise.h

Class Name

Synerise

Method Name

setCrashHandlingEnabled(_ enabled:)

Declaration

static func setCrashHandlingEnabled(_: Bool) -> Void

Parameters

Parameter Type Mandatory Default Description
enabled Bool yes - Enables/disables crash handling

Return Value

There is no return value.

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker