Documentation

iOS SDK (Swift)

Native Swift package for direct APNs push — no Firebase on iOS.

Install

Add the local Swift package from sdks/ios in Xcode → Add Package Dependencies.

Quick start

swift
import Payghaam

Payghaam.shared.initialize(PayghaamConfig(
    appId: "YOUR_PROJECT_ID",
    apiKey: "ek_client_...",
    baseUrl: "https://api.yourhost.com"
))

Task {
    try await Payghaam.shared.login(externalId: "user-123")
    _ = await Payghaam.shared.requestPushPermission()
}

In AppDelegate:

swift
func application(_ application: UIApplication,
                     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Task { try? await Payghaam.shared.setDeviceToken(deviceToken) }
}

APNs configuration

Configure Key ID, Team ID, Bundle ID, and .p8 key in the dashboard. Enable Push Notifications and App Groups on your target — details in iOS setup.

Notification Service Extension

Use shareConfig(appGroup:apiBase:apiKey:externalId:) so the NSE can report delivery when the app is terminated.

info

Note

The Swift SDK mirrors the Flutter plugin's iOS behavior without requiring Flutter.