Track your campaigns: WithautoTrackPushEvents(true), the SDK tracks body opened (default action). Action-button taps are not auto-tracked — handle them inUNUserNotificationCenterDelegate. Delivered metrics typically need a Notification Service Extension. See Push Notification Tracking. Reference: sdk-examples/ios.
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
Match the iOS example: plainAppDelegate + UNUserNotificationCenterDelegate for action buttons.
autoTrackPushEvents(true), body taps (UNNotificationDefaultActionIdentifier) are tracked as Opened. Action-button taps still need your didReceive handler.
MessagingPushConfigBuilder options
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
Body / campaign deep links appear asdeeplink_url (and sometimes ZIXFLOW.push.link). The iOS example opens them from UNUserNotificationCenterDelegate:
SDKConfigBuilder.deepLinkCallback for other SDK-forwarded URLs. Full property contract and action sample: Push Notification Tracking.
Custom Action Buttons
Named action buttons in a push payload are not registered by the SDK. Your app must pre-register a notification category at launch; Zixflow campaigns that include buttons use categoryZX_2BTN with action identifiers ACTION_0 and ACTION_1.
Payload format
Theaction_buttons field is a JSON-encoded string:
Register ZX_2BTN at launch
Register categories in application(_:didFinishLaunchingWithOptions:) (or equivalent startup):
- Maximum 2 buttons per notification (iOS system limit)
- Button index is 0-based (leftmost = index 0)
- Pre-registered titles can be generic (
Action 1,Action 2); campaign button names are tracked viaaction_name deeplinkmay be empty — handle that case in your navigation code- The SDK does not auto-register categories — the app must call
setNotificationCategories
Manual metrics
Body opens are covered byautoTrackPushEvents(true). For action buttons (and any custom path), call:
Zixflow-Delivery-ID / ZIXFLOW-Delivery-ID and the matching token keys. See Push Notification Tracking.
Delete device token
Troubleshooting
Enable
.logLevel(.debug) while integrating.