SDK lifecycle

Initialization


This method initializes Synerise.

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

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

static func initialize(clientApiKey: String) -> Void

Parameters:

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Profile (formerly Client) API Key

Return Value:
No value is returned.

Example:

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

Initialize with custom environment


This method initializes Synerise SDK with custom environment settings.

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

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

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

Parameters:

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

Return Value:
No value is returned.

Example:

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

Change Profile API Key dynamically


This method changes a Profile (formerly Client) API key dynamically.

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

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

Parameters:

Parameter Type Mandatory Default Description
clientApiKey String yes - Synerise Profile API Key (formerly Client API key)

Return Value:
No value is returned.

Set Request Validation Salt


This method sets the salt string for request validation.

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

static func setRequestValidationSalt(_: String?) -> Void

Parameters:

Parameter Type Mandatory Default Description
salt String no - Synerise Profile salt string for request validation

Return Value:
No value is returned.

Set up host application type


This method sets the Synerise SDK host application type.

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

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

Parameters:

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

Return Value:
No value is returned.

Set host application SDK plugin version


This method sets the Synerise SDK plugin version.

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

static func setHostApplicationSDKPluginVersion(_ version: String) -> Void

Parameters:

Parameter Type Mandatory Default Description
version String yes - Specifies the version of the Synerise SDK plugin in the host application

Return Value:
No value is returned.

Enable Debug Mode


This method enables or disables console logs from Synerise SDK.

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

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

static func setDebugModeEnabled(_: Bool) -> Void

Parameters:

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

Return Value:
No value is returned.

Enable Crash Handling


This method enables or disables crash handling by Synerise SDK.

Note: If set to true, Synerise SDK will send the client.applicationCrashed event with information about crash.

Declared In:
Headers/SNRSynerise.h

Class:
Synerise

Declaration:

static func setCrashHandlingEnabled(_: Bool) -> Void

Parameters:

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

Return Value:
No value is returned.

Set Synerise delegate


This method sets an object for Synerise delegate methods.

Declared In:
Headers/SNRSynerise.h

Related To:
SyneriseDelegate

Class:
Synerise

Declaration:

static func setDelegate(_ delegate: SyneriseDelegate)

Discussion:
Learn more about the methods and the purpose of this listener here.

😕

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