Settings
The settings module in our SDK allows you to change some SDK behaviors by changing options directly from your application.
This article includes configuration instruction and lists the currently available methods.
Configuring SDK
To ensure proper configuration of the SDK, remember that there are two types of settings:
- pre-initialization
- dynamic
Some of the pre-initialization settings are optional. If you want to use them, they must be configured before Synerise SDK is initialized, before invoking the Synerise.initialize(clientApiKey:)
method.
Pre-initialization settings:
Option | Default | Description |
---|---|---|
Synerise.settings.sdk.appGroupIdentifier |
nil | Identifies the app group that your application and its extensions belong to. |
Synerise.settings.sdk.keychainGroupIdentifier |
nil | Identifies the keychain group that your application and its extensions belong to. |
Synerise.settings.sdk.shouldDestroySessionOnApiKeyChange |
true | Specifies if a session should be destroyed after a Client’s API key changes. |
Synerise.settings.notifications.encryption |
false | Specifies if notifications from Synerise should be encrypted. |
The rest of the options can be changed dynamically anytime.
General
Enable/disable SDK
Parameter | Type | Default |
---|---|---|
Synerise.settings.sdk.enabled |
Bool |
true |
This parameter specifies if the SDK functionalities are enabled.
Set up App Group Identifier
Parameter | Type | Default |
---|---|---|
Synerise.settings.sdk.appGroupIdentifier |
String |
nil |
This parameter identifies the user defaults group used by applications and extensions belongs to.
Synerise SDK needs that configured to store your non-sensitive data and share it between your app and extensions.
Your App Group should be registered on the Apple Developer portal. It is recommended to use reverse-domain name style and prefix it with “group.” by default. For example, your App Group can be “group.com.synerise.sdk.sample”.
When your App Group is registered, add it as a capability on the Apple Developer portal in App ID Configuration and in Xcode in the Signing&Capabilities tab.
Documentation is available at Apple Developer - App Groups.
Once configured, you need to set it up in the SDK:
Synerise.initialize(clientApiKey:)
method.Synerise.settings.sdk.appGroupIdentifier = "group.com.synerise.sdk.sample"
Set up Keychain Group Identifier
Parameter | Type | Default |
---|---|---|
Synerise.settings.sdk.keychainGroupIdentifier |
String |
nil |
This parameter identifies the keychain group used by applications, extensions and services that your app belongs to.
Synerise SDK needs that configured to store your data safely and share it between your app and extensions.
Your Keychain Group Identifier is a calculated value of:
- your Keychain Group
- your $(AppIdentifierPrefix), also called Team ID.
For example, if your Keychain Group is set to “SharedItems” and your Team ID is “ABC1234DEF”, the complete literal that you should set as Keychain Group Identifier is “ABC1234DEF.SharedItems”.
Documentation is available at Apple Developer - Sharing Access to Keychain Items Among a Collection of Apps.
Once configured, you need to set it up in the SDK:
Synerise.initialize(clientApiKey:)
method.Synerise.settings.sdk.keychainGroupIdentifier = "ABC1234DEF.SharedItems"
Minimum time interval to refresh token
Parameter | Type | Default |
---|---|---|
Synerise.settings.sdk.minTokenRefreshInterval |
TimeInterval |
1800 |
This parameter sets a time interval (in seconds) counting backwards from the expiration time. Within this time, the token will be automatically refreshed by the SDK.
Maintaining Client session on different API keys
Parameter | Type | Default |
---|---|---|
Synerise.settings.sdk.shouldDestroySessionOnApiKeyChange |
Bool |
true |
This parameter specifies if session should be destroyed after client api key changes.
This option works only if you change the API key within one workspace.
To change the API key from a different workspace, use the following method: Client.changeApiKey(clientApiKey:)
.
Notifications
Enable/disable Push Notifications
Parameter | Type | Default |
---|---|---|
Synerise.settings.notifications.enabled |
Bool |
true |
This parameter specifies if handling notifications by the SDK is enabled.
Notification Encryption
Parameter | Type | Default |
---|---|---|
Synerise.settings.notifications.encryption |
Bool |
true |
This parameter specifies if notifications from Synerise should be encrypted.
Enable/disable In-App notification alerts
Parameter | Type | Default |
---|---|---|
Synerise.settings.notifications.disableInAppAlerts |
Bool |
true |
This parameter determines whether the SDK displays an additional alert in the application after receiving a notification.
If you have your own notifications implementation, you can disable In-App notification alerts from the Synerise SDK.
In-App Messaging
Set maximum time for In-app message rendering
Parameter | Type | Default |
---|---|---|
Synerise.settings.inAppMessaging.renderingTimeout |
TimeInterval |
2.0 |
This parameter sets a timeout for In-app message rendering.
Tracker
Minimum number of events in queue to send
Parameter | Type | Default | Minimum Value | Maximum Value |
---|---|---|---|---|
Synerise.settings.tracker.minBatchSize |
Int |
10 | 1 | 100 |
This parameter sets a minimum number of events in queue required to send them.
minBatchSize
.Maximum number of events in queue to send
Parameter | Type | Default | Minimum Value | Maximum Value |
---|---|---|---|---|
Synerise.settings.tracker.maxBatchSize |
Int |
100 | 1 | 100 |
This parameter sets a maximum number of events which may be sent in a single batch.
Timeout to send events automatically
Parameter | Type | Default | Minimum Value |
---|---|---|---|
Synerise.settings.tracker.autoFlushTimeout |
TimeInterval |
5.0 | 0.5 |
This parameter sets the time (in milliseconds) required before an attempt is made to sent the queue.
Require/do not require backend time synchronization to send events
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.isBackendTimeSyncRequired |
Bool |
true |
This parameter specifies if events should be sent when server time synchronization has failed.
Setup for location event to be sent automatically
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.locationAutomatic |
Bool |
false |
This parameter specifies if location events are sent automatically.
Enable/disable Declarative Tracking
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.tracking.enabled |
Bool |
true |
This parameter specifies if the Declarative Tracking functionality is enabled.
Enable/disable auto-tracking
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.autoTracking.enabled |
Bool |
true |
This parameter specifies if auto-tracking functionality is enabled.
Auto-Tracking mode
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.autoTracking.mode |
TrackerAutoTrackMode |
.disabled |
This parameter sets the mode of auto-tracking.
Available modes:
.disabled
- listeners are disabled (default)..eager
- listeners are set to on-touch only..plain
- listeners are set to on-click only..fine
- listeners are attached to nearly everything in your app (even to activities andviewDidAppear
, the method that recordsVisitedScreen
events).
Classes excluded from Auto-Tracking
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.autoTracking.excludedClasses |
[AnyClass] |
[] |
This parameter excludes classes from Auto-Tracking.
View Tags excluded from Auto-Tracking
Parameter | Type | Default |
---|---|---|
Synerise.settings.tracker.autoTracking.excludedViewTags |
[NSNumber] |
[] |
This parameter excludes view tags from Auto-Tracking.
Injector
Enable/disable automatic starting of Mobile Campaigns
Parameter | Type | Default |
---|---|---|
Synerise.settings.injector.automatic |
Bool |
false |
This parameter specifies if Synerise Mobile Campaigns are processed automatically or not.