Skip to main content
Complete guide to implementing push notifications with Zixflow using Apple Push Notifications (APNs) or Firebase Cloud Messaging (FCM).
Track your campaigns: With autoTrackPushEvents(true), the SDK tracks body opened (default action). Action-button taps are not auto-tracked — handle them in UNUserNotificationCenterDelegate. Delivered metrics typically need a Notification Service Extension. See Push Notification Tracking. Reference: sdk-examples/ios.

Prerequisites

  1. Add push credentials (APNs or FCM) in the Zixflow dashboard
  2. Enable Push Notifications capability in Xcode
  3. Install the push module:
    • ZixflowMessagingPushAPN for APNs
    • ZixflowMessagingPushFCM for FCM
Test on a physical device — the simulator cannot receive remote push.

Apple Push Notifications (APNs)

Step 1: Enable Push Notifications in Xcode

  1. Select your project in Xcode
  2. Go to TargetSigning & Capabilities
  3. Click + CapabilityPush Notifications
  4. Click + CapabilityBackground Modes → enable Remote notifications

Step 2: Initialize core SDK and MessagingPushAPN

Match the iOS example: plain AppDelegate + UNUserNotificationCenterDelegate for action buttons.
With 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 call identify():

Step 4: Rich push with Notification Service Extension

  1. FileNewTargetNotification Service Extension
  2. Add ZixflowMessagingPushAPN to the extension target
  3. Share an App Group between the app and extension (group.{bundleId}.zixflow)
CocoaPods extension target:
NotificationService.swift:
Set the same appGroupId when initializing push in the main app:

Step 5: Manual device token registration (optional)

If you disable autoFetchDeviceToken, forward the APNs token via MessagingPush.shared:

Firebase Cloud Messaging (FCM)

Step 1: Firebase project

  1. Create/select a project in the Firebase console
  2. Add your iOS app and download GoogleService-Info.plist into 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 a FirebaseService adapter for automatic APNs↔FCM token bridging. Most apps can use MessagingPush.initialize plus registerDeviceToken(fcmToken:) as shown above.

Step 4: FCM Notification Service Extension


Body / campaign deep links appear as deeplink_url (and sometimes ZIXFLOW.push.link). The iOS example opens them from UNUserNotificationCenterDelegate:
Optional: 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 category ZX_2BTN with action identifiers ACTION_0 and ACTION_1.

Payload format

The action_buttons field is a JSON-encoded string:
Parsed structure:

Register ZX_2BTN at launch

Register categories in application(_:didFinishLaunchingWithOptions:) (or equivalent startup):
Rules:
  • 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 via action_name
  • deeplink may be empty — handle that case in your navigation code
  • The SDK does not auto-register categories — the app must call setNotificationCategories
For open + action-click tracking (including property names), see Push Notification Tracking.

Manual metrics

Body opens are covered by autoTrackPushEvents(true). For action buttons (and any custom path), call:
Read delivery fields from Zixflow-Delivery-ID / ZIXFLOW-Delivery-ID and the matching token keys. See Push Notification Tracking.

Delete device token

Troubleshooting

Enable .logLevel(.debug) while integrating.