💡 Track your campaigns: With auto-tracking enabled, the SDK tracks delivery and opens. For metrics details, see Push Notification Tracking.
Prerequisites
- Add push credentials (APNs or FCM) in the Zixflow dashboard
- Enable Push Notifications capability in Xcode
- Install the push module:
ZixflowMessagingPushAPNfor APNsZixflowMessagingPushFCMfor FCM
Apple Push Notifications (APNs)
Step 1: Enable Push Notifications in Xcode
- Select your project in Xcode
- Go to Target → Signing & Capabilities
- Click + Capability → Push Notifications
- Click + Capability → Background Modes → enable Remote notifications
Step 2: Initialize core SDK and MessagingPushAPN
ZixflowAppDelegateWrapper is recommended: it registers device tokens, handles clicks, and tracks opens for Zixflow pushes.
MessagingPushConfigBuilder options
| Option | Type | Default | Description |
|---|---|---|---|
autoFetchDeviceToken | Bool | true | Automatically register the device token |
autoTrackPushEvents | Bool | true | Track delivered and opened metrics |
showPushAppInForeground | Bool | true | Show pushes while the app is active |
appGroupId | String? | nil | App Group for NSE delivery tracking (auto-infers group.{bundleId}.zixflow if omitted) |
logLevel | ZixflowLogLevel | .error | Logging for the push module |
Step 3: Identify users
Device tokens are associated with a profile when you callidentify():
Step 4: Rich push with Notification Service Extension
- File → New → Target → Notification Service Extension
- Add
ZixflowMessagingPushAPNto the extension target - Share an App Group between the app and extension (
group.{bundleId}.zixflow)
appGroupId when initializing push in the main app:
Step 5: Manual device token registration (optional)
If you disableautoFetchDeviceToken, forward the APNs token via MessagingPush.shared:
Firebase Cloud Messaging (FCM)
Step 1: Firebase project
- Create/select a project in the Firebase console
- Add your iOS app and download
GoogleService-Info.plistinto the Xcode project
Step 2: Install dependencies
Step 3: Initialize Firebase, Zixflow, and push
Configure Firebase first, then initialize Zixflow and the push module. Forward FCM registration tokens to Zixflow:Advanced:MessagingPushFCM.internalSetup(withConfig:firebaseService:)accepts aFirebaseServiceadapter for automatic APNs↔FCM token bridging. Most apps can useMessagingPush.initializeplusregisterDeviceToken(fcmToken:)as shown above.
Step 4: FCM Notification Service Extension
Deep links
Zixflow push payloads may include a deep link atZIXFLOW.push.link. Prefer SDKConfigBuilder.deepLinkCallback so links work consistently (including with FCM swizzling):
Manual metrics (optional)
If you are not using the AppDelegate wrapper / auto-tracking, call:ZIXFLOW-Delivery-ID and ZIXFLOW-Delivery-Token. See Push Notification Tracking.
Delete device token
Troubleshooting
| Issue | Check |
|---|---|
| No pushes | Physical device; Push capability; dashboard credentials; user identify() called |
| No rich media / delivery metrics | NSE installed; App Groups match; mutable-content: 1 in payload |
| Deep links not opening | Set deepLinkCallback; confirm ZIXFLOW.push.link in payload |
.logLevel(.debug) while integrating.