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
| iOS | 15.0+ |
| Swift | 5.10+ (Xcode 15.4+) |
| For events only | No push entitlement, no permission, no token needed |
| For push | Your own APNs auth key (.p8), uploaded to Arsel. No Firebase project |
| Runtime deps | None |
Install
Xcode → File → Add Package Dependencies… → the repository URL. Or in Package.swift:
.package(url: "https://github.com/BasicsEngage/arsel-ios-sdk.git", from: "1.0.0")
Two products ship:
Arsel— the SDK. Link it into your app target.ArselNotificationExtension— a small helper for a Notification Service Extension, providingdeliveredengagements 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)
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 Push → iOS 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 — BasicsEngage/arsel-ios-sdk, MIT licensed.
| Quickstart | Install → initialize → permission → first event, end to end |
| API reference | Every method: signature, arguments, threading |
| Push notifications | Tokens, permission UX, delegate wiring, rich push, engagement |
| Identity | Anonymous → identified, merges, reset() vs optOut() |
| Changelog |
A runnable end-to-end example lives in Examples/Sample, which resolves the SDK as a local package.