FI
ForgePush
Swift Package v1.0.0

ForgePush

Push notification management for iOS.
Permissions, tokens, silent routing, visible routing — four focused libraries.

ForgePushPermission ForgePushToken ForgeSilentPush ForgeVisiblePush
$ .package(url: "...ForgePush", from: "1.0.0")

Quick Example

TaskFlowApp.swift
import ForgePushPermission
import ForgePushToken
import ForgeSilentPush

// 1. Request permission at the right moment
let permission = PushPermission()
try await permission.request()

// 2. Register for remote notifications via PushTokenManager
let tokenManager = PushTokenManager()
await tokenManager.registerForRemoteNotifications()

// 3. Add handlers and route incoming silent pushes
let silentRouter = SilentPushRouter(
    connectivity: connectivityObserver,
    protectedData: protectedDataObserver
)
silentRouter.addHandler(TaskSyncHandler())
silentRouter.addHandler(ReminderUpdateHandler())

// In AppDelegate:
func application(_ application: UIApplication,
    didReceiveRemoteNotification userInfo: [AnyHashable: Any],
    fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    silentRouter.handlePush(payload: userInfo, completionHandler: completionHandler)
}

What's Inside

!

Permission

PushPermission()
.request()

Request authorization, check status, and open Settings — cleanly wrapped.

#

Token Management

PushTokenManager
.tokenStream

Bridge APNs callbacks into an async stream. Observe token updates reactively.

~

Silent Routing

SilentPushRouter
.handlePush(payload:)

Register multiple handlers and let the router dispatch background pushes automatically.

*

Visible Routing

VisiblePushRouter
.handleResponse(_:)

Dispatch foreground and tapped notification responses to the right handler.

Forge Ecosystem