Installation and configuration (iOS)

In this article, you will find out how to install and initialize the Synerise SDK in an iOS application. While performing the actions from this guide, keep the presented order.

Important: The Settings article contains additional information about SDK behaviors you may need prior to configuration.

If you want to find out what kind of benefits you can get from integrating with mobile SDK, go here.


You need:

  • Access to a workspace
  • A Profile API Key
    When creating the API key, use allowlisting or denylisting to only allow the events you intend to use.
  • One of the following dependency managers:
    • CocoaPods - CocoaPods is a dependency manager for iOS projects.
    • Carthage - Carthage is a simple, decentralized dependency manager for iOS projects.
    • Swift Package Manager - Swift Package Manager (SPM) is a dependency manager built into Xcode.
  • Recommended environment:
    • Xcode 15
    • iOS SDK 17
  • Target deployment: iOS 9.0+

Apple Frameworks

The Synerise SDK references the following Apple frameworks:

  • Foundation.framework
  • UIKit.framework
  • CoreGraphics.framework
  • SystemConfiguration.framework
  • MobileCoreServices.framework
  • CoreTelephony.framework
  • Security.framework
  • CommonCrypto.framework
  • WebKit.framework
  • UserNotifications.framework

3rd Party Frameworks



  1. Add CocoaPods dependency to Synerise SDK into your Podfile:
        target YOUR_PROJECT_TARGET do
          pod 'SyneriseSDK'
  2. Execute the following shell command in the directory depending on your project configuration:
        pod repo update  
        pod install

Swift Package Manager (SPM)

  1. Go to Xcode project’s settings and navigate to the Package Dependencies tab.
  2. Below the packages list, click the Add button.
  3. Enter the URL of Synerise SDK repository ( in the search text field.
  4. Under the Dependency Rule section, select the SDK version. Finally, click Add Package.
  5. Select the package that best suits your needs and click Add Package.


  1. Add the Carthage dependency to Synerise SDK into your Cartfile:

        github "synerise/ios-sdk"
  2. Execute the shell command in directory depending on your project configuration:

        carthage update
  3. Go to Xcode project target’s General section.

  4. In Finder, open <YOUR_XCODE_PROJECT_DIRECTORY>/Carthage/Build/iOS

  5. Drag SyneriseSDK.framework to Embedded Binaries.

  6. Make sure the Copy items if needed option is selected.

  7. Click Finish.


Setting up

  1. Go to Xcode project target’s General section.

  2. Find the Other Linker Flags property and add the -ObjC flag.

  3. If you are going to use push notifications:

    1. Go to Info.plist
    2. Add a row for Required background mode with the following array type value: App downloads content in response to push notifications or add the code below directly:
  4. If you are going to use HTTP addresses (instead of only HTTPS), change the allowlist domains in your app by adding configuration to Info.plist in one of the following ways:

    • Add configured domain/domains that you need.
                  <!--Include to allow subdomains-->
                  <!--Include to allow HTTP requests-->
                  <!--Include to specify minimum TLS version-->
    • Give permission for all domains.

Importing Synerise SDK

Import the Synerise SDK header into the files that contain code relating to SDK.

import SyneriseSDK
Note: In Objective-C, you can include it in your Prefix Header (PCH) and Synerise SDK will be imported to all files automatically.

Basic initialization

Initialize Synerise SDK and provide the Profile API Key.

You may initialize it wherever you want and when you need.

Synerise.initialize(clientApiKey: "YOUR_CLIENT_API_KEY") // 1
Synerise.setDebugModeEnabled(false) // 2
Synerise.setCrashHandlingEnabled(true) // 3
Synerise.setDelegate(self) // 4

Basic methods you need:

  1. Synerise.initialize(clientApiKey:) - Initializes Synerise SDK.
  2. Synerise.setDebugModeEnabled(_:) - Enables debug mode for Synerise SDK. See Debug mode section for more information.
  3. Synerise.setCrashHandlingEnabled(_:) - Enables crash handling. Synerise SDK sends a crash event automatically when an uncaught exception occurs.
  4. Synerise.setDelegate(_:)- Sets delegate to handle main actions from Synerise SDK. See SyneriseDelegate section for more information.

Initialization with custom API environment

To change API base URL for on-premise installations, use the following initialization method:

Synerise.initialize(clientApiKey: "YOUR_PROFILE_API_KEY", baseUrl: "YOUR_API_BASE_URL")

Advanced initialization

This is an example of advanced initialization with:

  • custom API base URL for on-premise installations
  • request validation salt configured
  • debug mode enabled
  • crash handling enabled
  • most of the settings options available
  • main delegate SyneriseDelegate
  • client’s state delegate ClientStateDelegate
Important: We highly recommend to configure settings when Synerise SDK is initialized, before invoking the Synerise.initialize(clientApiKey:) method. See Settings section for more details about settings options.
Important: Secure sensitive keys (for example, clientApiKey and requestValidationSalt) with mechanisms like string obfuscation or encryption.
Note: You can find more information about all Synerise iOS SDK delegates here.
Synerise.settings.sdk.enabled = true
Synerise.settings.sdk.appGroupIdentifier = "YOUR_APP_GROUP_IDENTIFIER"
Synerise.settings.sdk.keychainGroupIdentifier = "YOUR_KEYCHAIN_GROUP_IDENTIFIER"
Synerise.settings.sdk.minTokenRefreshInterval = 1800
Synerise.settings.sdk.shouldDestroySessionOnApiKeyChange = false

Synerise.settings.notifications.enabled = true
Synerise.settings.notifications.disableInAppAlerts = true
Synerise.settings.notifications.encryption = false

Synerise.settings.tracker.autotracking.enabled = true
Synerise.settings.tracker.autotracking.mode = AutoTrackMode.Fine
Synerise.settings.tracker.autotracking.excludedClasses = [SampleViewController.self]
Synerise.settings.tracker.autotracking.excludedViewTags = [0, 1, 2]

Synerise.settings.tracker.tracking.enabled = true

Synerise.settings.tracker.minBatchSize = 10
Synerise.settings.tracker.maxBatchSize = 100
Synerise.settings.tracker.autoFlushTimeout = 5.0
Synerise.settings.tracker.autoTracking.mode = .fine
Synerise.settings.tracker.locationAutomatic = true

Synerise.settings.injector.automatic = true

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


Initialization process

During initialization, the library starts and when it is ready or an error occurs, the SDK notifies you.

When the delegate method is called, Synerise is ready to use.

// MARK: - SyneriseDelegate

// This method is called when the Synerise SDK is initialized.
func snr_initialized() {

// This method is called when an error occurs while initializing the Synerise SDK.
func snr_initializationError(error: Error) {

Debug Mode

You can enable debug logs for Synerise SDK by method Synerise.setDebugModeEnabled(_:).

WARNING: Do not use Debug Mode in a release version of your application.
Synerise.setDebugModeEnabled(true) // Enables logging for all modules

You can receive some logs about:

  • Core: push notifications
  • Tracker: auto-tracked events, declarative events, sending process
  • Client: customer state, authorization
  • Injector: campaigns, UI
  • Promotions: promotions, vouchers
  • Content: content widget, documents, recommendations

Privacy manifest

From 1 May 2024, Apple requires you to add a privacy manifest. It’s a file in your project that describes your reason and method for collecting data.

Third-party frameworks that track data should have a privacy manifest. When you create the application privacy report, these privacy manifest files are automatically aggregated into a single file.

Synerise supports privacy manifests since SDK version 4.17.0. When you use an SDK version older than 4.17.0, refer to the Synerise API usage requirements defined below when creating an Apple privacy manifest.

APIs usage

API Reason Description
User defaults APIs CA92.1
Synerise uses User Defaults to persist the SDK data and share them between the application and extensions


Synerise does not track any data that is protected by the App Tracking Transparency framework.

Collected Data

Data type Value Purpose
User ID NSPrivacyCollectedDataTypeUserID Analytics, Product Personalization
Other usage data NSPrivacyCollectedDataTypeOtherUsageData Analytics, Product Personalization, App Functionality
Product interaction NSPrivacyCollectedDataTypeProductInteraction Analytics
Advertising data NSPrivacyCollectedDataTypeAdvertisingData Other Purposes, App Functionality
Crash data NSPrivacyCollectedDataTypeOtherUserContent Analytics

Warnings and limitations

Be careful with keychain deletion operations due to the possibility of deleting Synerise data. All the SDK library data keys are named snr.[KEY_NAME].


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.



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