iOS SDK
The iOS SDK is one Swift package with a complete facade and optional feature products.
Requirements
- iOS 15 or later;
- Swift 5.9 or later;
- an Engage
eng_app_…app key; - Push Notifications capability and APNs credentials for push.
Install with Swift Package Manager
In Xcode choose File → Add Package Dependencies and enter:
https://github.com/mathias8dev/engage-ios.gitSelect exact version 2.1.0 and add EngageSDK to the application target.
| Product | Purpose |
|---|---|
EngageCore | installation, profile, privacy, events, actions, flags, preferences, sync |
EngagePush | APNs token lifecycle, notification events, actions, receipts |
EngagePushServiceExtension | extension-safe rich media handling |
EngageInApp | remote schedules, local evaluation, overlays, placements |
EngageMessageCenter | inbox, pagination, mutations, rendering documents |
EngageMessageCenterDivKit | SwiftUI inbox and DivKit rendering |
EngageSDK | complete facade |
Start
import EngageSDK
Engage.start(config: EngageConfig(
appKey: BuildConfiguration.engageAppKey,
logLevel: .verbose
))Start before accessing another facade. Engage synchronously installs a buffering notification delegate before asynchronous module work. A cold-launch notification response is retained until push is ready. Any host delegate already installed is preserved.
Forward APNs registration
Engage does not swizzle UIApplicationDelegate. Forward both callbacks:
func application(
_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
Engage.push.didRegisterForRemoteNotifications(deviceToken: deviceToken)
}
func application(
_ application: UIApplication,
didFailToRegisterForRemoteNotificationsWithError error: Error
) {
Engage.push.didFailToRegisterForRemoteNotifications(error: error)
}The host owns the permission prompt. Engage requests APNs registration and synchronizes the resulting token; it never uploads through Firebase.
Preference Center
Available on the current
developbranch and intended for the next iOS release.
Present the ready-made controller from the current hierarchy:
Engage.preferenceCenter.display("marketing")When the host owns navigation or embedding, request the controller instead:
let controller = Engage.preferenceCenter.makeViewController(
"marketing",
materialTheme: .system
)
navigationController?.pushViewController(controller, animated: true)PreferenceCenterMaterialTheme.system follows the current appearance. Supply explicit semantic colors when the center must match an application theme. The controller localizes its built-in states and renders an explicit unavailable state when no matching published center exists.
Use Engage.preferenceCenter.center(key) for a headless implementation. Snapshot semantics and mutation APIs are detailed in Preferences, feature flags, and privacy.
Modular integration
Applications selecting feature products instead of EngageSDK must start Core and activate retained modules. Prepare push synchronously before asynchronous setup:
import EngageCore
import EngagePush
PushModule.prepareForLaunch()
EngageCore.start(config: config)
let push = PushModule.activate()Prefer the complete product unless reducing the dependency surface is an explicit requirement.