iOS Swift · SPM · zero dependencies

Native iOS push with the Notibase Swift SDK — from an empty Apple Developer account to a tracked, clickable notification.

1 · Get your APNs credentials

Notibase sends through APNs with a token-based .p8 auth key — the modern method: one key covers all your apps and it never expires.

  1. Apple Developer membership

    You need the paid Apple Developer Program ↗ ($99/yr) — free accounts cannot send push.

  2. Create the APNs auth key

    Open Certificates, Identifiers & Profiles → Keys ↗+ → name it, tick Apple Push Notifications service (APNs) → Continue → Register.

  3. Download the .p8 — once

    Apple lets you download the key file one time only. Note the Key ID shown next to it, and your Team ID (top-right of the developer portal, e.g. ABCDE12345).

  4. Enable the capability in Xcode

    Your target → Signing & Capabilities+ CapabilityPush Notifications. Note your Bundle ID (e.g. com.yourco.app).

  5. Upload to Notibase

    Console → your app → SettingsApple iOS (APNs) → drop the .p8 file (the Key ID auto-fills from AuthKey_XXXX.p8 filenames), add Team ID + Bundle ID. We validate against APNs before storing (envelope-encrypted). The channel flips to ✓ configured.

2 · Install the SDK

// Xcode → File → Add Package Dependencies… → paste:
https://github.com/notibaseorg/notibase-ios

// …and choose version 0.2.1 (or "Up to Next Major").
// Package.swift:
.package(url: "https://github.com/notibaseorg/notibase-ios.git", from: "0.2.1")

Foundation-only — zero dependencies, builds everywhere Swift does.

3 · Initialize & register

import Notibase

// AppDelegate
func application(_ app: UIApplication,
    didFinishLaunchingWithOptions opts: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  Notibase.configure(clientKey: "ck_live_…")
  Notibase.requestAuthorization { granted in
    if granted { DispatchQueue.main.async { app.registerForRemoteNotifications() } }
  }
  return true
}

func application(_ app: UIApplication,
    didRegisterForRemoteNotificationsWithDeviceToken token: Data) {
  Notibase.setAPNsToken(token)     // registers the device with Notibase
}

4 · Click tracking

Report notification taps from your UNUserNotificationCenter delegate — one line; taps power the Clicked and CTR columns in the console:

func userNotificationCenter(_ center: UNUserNotificationCenter,
    didReceive response: UNNotificationResponse,
    withCompletionHandler completion: @escaping () -> Void) {
  Notibase.trackNotificationOpen(userInfo:
      response.notification.request.content.userInfo)
  completion()
}

The payload's nb_m / nb_d / nb_o keys are added by the Notibase send pipeline; notifications from other services are ignored safely.

5 · Identify, track, inbox

Notibase.identify("user-42", signature: sig)     // see Security → identity verification
Notibase.track("purchase", properties: ["value": 9.99])
Notibase.inbox { items in /* render your notification center */ }
Notibase.inboxMarkRead([itemId])
Test on a real device — the iOS simulator cannot receive APNs pushes. Use the development APNs environment toggle in Settings while running debug builds from Xcode.
← Android SDKFlutter SDK →