Skip to main content

iOS SDK

A Swift Package with zero dependencies — events, identity and push notifications for iOS. Events and identity work on a device that has never granted notification permission and holds no push token; only delivery needs push.

Requirements​

iOS15.0+
Swift5.10+ (Xcode 15.4+)
For events onlyNo push entitlement, no permission, no token needed
For pushYour own APNs auth key (.p8), uploaded to Arsel. No Firebase project
Runtime depsNone

Install​

Xcode → File → Add Package Dependencies… → the repository URL. Or in Package.swift:

.package(url: "https://github.com/Arsel-SA/arsel-ios-sdk.git", from: "1.4.0")

Two products ship:

  • Arsel — the SDK. Link it into your app target.
  • ArselNotificationExtension — a small helper for a Notification Service Extension, providing delivered engagements and rich media. Link it only into the extension target. Optional.

Initialize​

import Arsel

// AppDelegate / App init — early, once.
Arsel.initialize(config: ArselConfig(
clientKey: "pub_…",
baseUrl: "https://api.arsel.sa"))

Arsel.track("product.viewed", properties: ["sku": "A-1023", "price": 149.99])

// On login. Everything tracked beforehand merges onto this contact.
Arsel.identify(externalId: user.id)

From 1.4.0 the SDK reports push opens and clicks by itself — there is no notification delegate code to write, the same as on Android and web. On older versions those rates stay at zero unless your delegate calls the SDK's handlers; see Push notifications.

clientKey is the organization's publishable pub_ key. Your secret be_ API key is not safe in an app — anyone can inspect an IPA. See Authentication.

Push goes directly to APNs​

Arsel sends to iOS through Apple itself, so there is no Firebase project in the path and nothing to link. Hand the SDK the token Apple gives you:

func application(
_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
Arsel.setPushToken(apns: deviceToken)
}

For that token to be deliverable, upload your APNs auth key once under Integration > Push in the dashboard: the .p8 file, its Key ID, your Team ID, and your bundle ID. Apple lets you download a .p8 only once, so keep your copy.

Apple runs separate sandbox and production hosts, and a token minted for one is rejected by the other. The SDK detects which your build was signed for and reports it at registration, so a single uploaded key serves debug, TestFlight and App Store builds with no extra configuration.

The rest of the org-side setup is in Setting up push.

Full documentation​

The SDK's own repository is the reference, and it is versioned with the tag you resolve — Arsel-SA/arsel-ios-sdk, MIT licensed.

QuickstartInstall → initialize → permission → first event, end to end
API referenceEvery method: signature, arguments, threading
Push notificationsTokens, permission UX, delegate wiring, rich push, engagement
IdentityAnonymous → identified, merges, reset() vs optOut()
Changelog

A runnable end-to-end example lives in Examples/Sample, which resolves the SDK as a local package.