Skip to main content

iOS SDK

A Swift Package with zero dependencies for events, identity and push notifications on iOS. Events and identity work without notification permission or a push token.

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 itself, with no notification delegate code to write. 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, because anyone can inspect an IPA. See Authentication.

Push goes directly to APNs​

Arsel sends to iOS through APNs, with no Firebase project to set up or link. Pass 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 Push > Setup 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 one uploaded key serves debug, TestFlight and App Store builds.

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

Full documentation​

The reference is the SDK's repository, Arsel-SA/arsel-ios-sdk (MIT), versioned with the tag you resolve.

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.