Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Synerise/ios-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠ The repository is migrated to Synerise iOS SDK! ⚠

The Synerise iOS SDK is no longer live on this address. All new releases will only be published on the new Synerise iOS SDK. After June 20, 2024 this repository will no longer be maintained.



Synerise iOS SDK (v4.17.0)

Platform Languages GitHub release CocoaPods SPM compatible Carthage compatible Synerise Documentation


About

Synerise SDK for iOS.

⚠️ For versions higher than 4.17.0, please refer to this repository: Synerise iOS SDK

Documentation

Most up-to-date documentation is available at Developer Guide - Mobile SDK.

Requirements

  • Access to workspace
  • A Profile API Key
  • Xcode 15 and iOS SDK 17
  • iOS 9.0+ minimum deployment target
  • Valid architectures: arm64 devices and arm64, x86_64 simulators

Installing Synerise SDK with CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

  1. You can install it with the following command:
gem install cocoapods
  1. Once you have CocoaPods installed you should add below code into your Podfile in Xcode:
platform :ios, '14.0'
use_frameworks!

target YOUR_PROJECT_TARGET do
  pod 'SyneriseSDK'
end
  1. To install the Synerise SDK, run the following command in the directory of your Xcode app project:
pod install
  1. When you want to upload to the latest version, execute the following command:
pod update

Installing Synerise SDK with Swift Package Manager (SPM)

Swift Package Manager (SPM) is a dependency manager built into Xcode.

  1. Go to Xcode project’s settings and navigate to the Package Dependencies tab.
  2. Click on the add button below the packages list.
  3. Enter the URL of Synerise SDK repository (https://github.com/Synerise/ios-sdk) 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.

Installing Synerise SDK with Carthage

Carthage is a simple, decentralized dependency manager for iOS projects.

  1. You can install it with the following command:
brew install carthage
  1. Once you have CocoaPods installed you should add following line to your Cartfile:
github "synerise/ios-sdk"
  1. To install the Synerise SDK, run the following command in the directory of your Xcode app project:
carthage update --use-xcframeworks --platform ios
  1. Go to your Xcode project's "General" settings. Open <YOUR_XCODE_PROJECT_DIRECTORY>/Carthage/Build/iOS in Finder and drag SyneriseSDK.framework to the "Embedded Binaries" section in Xcode. Make sure Copy items if needed is selected and click Finish.

Import Synerise SDK

You will need to import the Synerise SDK header into the files that contain code relating to Synerise SDK.

Swift:

import SyneriseSDK

Objective-C:

<SyneriseSDK/SyneriseSDK.h>

In Objective-C, you can either include it in your AppName-Prefix.pch file.

Initialization

First of all, you need to initialize Synerise iOS SDK and provide Profile API Key.

To get Profile API Key, please sign in to your Synerise account and visit https://app.synerise.com/settings/apikeys. Then, generate new API Key for Profile audience.

Swift:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let clientApiKey = "YOUR_PROFILE_API_KEY"

    Synerise.initialize(clientApiKey: clientApiKey)
}

Objective-C:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    static NSString *clientApiKey = @"YOUR_PROFILE_API_KEY";

    [SNRSynerise initializeWithClientApiKey:clientApiKey];
}

Changelog

Changelog can be found here.

Author

Synerise, [email protected]. If you need support please feel free to contact us.