Skip to content

Install the iOS SDK

The SDK is a Swift package, CrmSdk, with no dependencies of its own.

  1. File › Add Package Dependencies…
  2. Paste the package’s address into the search field: https://github.com/MichalTDev/crm-ios.git
  3. Under Dependency Rule, choose Up to Next Major Version from 0.2.0.
  4. Add the CrmSdk library to your app’s target.

If your app, or a module of it, is itself a package:

Package.swift
dependencies: [
.package(url: "https://github.com/MichalTDev/crm-ios.git", from: "0.2.0"),
],
targets: [
.target(
name: "MyApp",
dependencies: [.product(name: "CrmSdk", package: "crm-ios")]
),
]

Then import CrmSdk where you use it.

Copy your app’s key (app_…) from the App key card on Settings › your app › Developers › Install. The Install card on the same tab shows the steps for the Flutter package. For an iOS app, follow these pages instead. In Test, the card shows the test app’s key (app_test_…, see Test mode).

Each release is a tag. The package’s CHANGELOG.md lists the releases, and each one says the oldest PurrCRM it needs. To move to a newer release, use File › Packages › Update to Latest Package Versions in Xcode, or change from: in Package.swift.

Against an older PurrCRM, the SDK goes without what that version does not have, and the rest works as before. An older SDK against a newer PurrCRM ignores what it does not know.

Every request says which SDK sent it and its version (X-Crm-Sdk-Kind: ios, X-Crm-Sdk: 0.2.0); crmSdkVersion holds the version in code. Your team can set the oldest version they want people on (Settings › your app › General › Money › Advanced › Oldest SDK); your app reads it as crm.publicApp.value?.minSdkVersion to suggest an update. PurrCRM refuses no version for it. It is one number for every SDK, so compare it with crmSdkVersion only if your team set it with the iOS SDK in mind.

  • iOS 13 or later.
  • Swift 6 tools: Xcode 16 or later. The package is built in the Swift 6 language mode; your app may use either mode.
  • The package brings no Firebase, analytics or crash reporter of its own. For pushes your app adds Firebase Messaging itself (Push).

The package ships its own privacy manifest (PrivacyInfo.xcprivacy), which Xcode gathers into your app’s privacy report when you archive. It declares:

  • No tracking, and no tracking domains.
  • Data collected, all linked to the user and none of it for tracking: the user’s id and customer support (for the app’s functionality), product interaction (analytics and the app’s functionality), and a device id (the push token, for the app’s functionality).
  • One required-reason API: UserDefaults, reason CA92.1 (the SDK keeps its own state there, read and written by the app only).

Your app’s own privacy manifest and its App Store privacy answers still list what your app collects with it. The SDK keeps no token on the phone: tokens stay in memory.

Initialise the SDK.