ForgePush
Push notification management for iOS.
Permissions, tokens, silent routing, visible routing — four focused libraries.
.package(url: "...ForgePush", from: "1.0.0") Quick Example
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
.request()
Request authorization, check status, and open Settings — cleanly wrapped.
Token Management
.tokenStream
Bridge APNs callbacks into an async stream. Observe token updates reactively.
Silent Routing
.handlePush(payload:)
Register multiple handlers and let the router dispatch background pushes automatically.
Visible Routing
.handleResponse(_:)
Dispatch foreground and tapped notification responses to the right handler.
Forge Ecosystem
ForgeInject
Lightweight dependency injection for iOS. Property wrapper. Thread-safe.
ForgeObservers
Reactive system observers. Connectivity, lifecycle, keyboard, and more.
ForgeStorage
Type-safe persistence. Key-value, file storage, and Keychain.
ForgeBackgroundTasks
BGTaskScheduler registration, scheduling, and dispatch for iOS.
ForgeLocation
Location-based triggers. Geofencing, significant changes, and visits.
ForgePush
currentPush notification management. Permissions, tokens, and routing.
ForgeOrchestrator
Sequence, pipeline, and monitor orchestrators for iOS app flows.