Skip to main content

CocoaPods Integration

The Zixflow React Native SDK automatically integrates with the native iOS SDK via CocoaPods or Swift Package Manager. If you’re using React Native 0.60 or higher, dependencies are auto-linked.
  1. Navigate to the iOS directory:
cd ios
  1. Install CocoaPods dependencies:
pod install
  1. Open the workspace in Xcode:
open YourApp.xcworkspace
The SDK will automatically include the necessary Zixflow iOS modules:
  • ZixflowCommon
  • ZixflowDataPipelines
  • ZixflowMessagingPush
  • ZixflowMessagingPushAPN (for APNs)
  • ZixflowMessagingInApp

Swift Package Manager Integration

If you prefer Swift Package Manager (SPM) for the native iOS SDK, configure your project with the package source URL provided by Zixflow (the native iOS SDK repository is private and is not linked from these docs).
  1. Open your project in Xcode
  2. Go to File > Add Package Dependencies
  3. Enter the package URL provided by Zixflow
  4. Select the version: Use 1.1.3 or higher
  5. Add the following modules to your app target:
    • Zixflow (umbrella module)
    • ZixflowDataPipelines
    • ZixflowMessagingPushAPN
    • ZixflowMessagingInApp
For most React Native apps, CocoaPods auto-linking (above) is sufficient—you do not need to add the native iOS package manually.

Push Notification Setup (APNs)

To enable Apple Push Notifications (APNs):
  1. Enable Push Notifications capability in Xcode:
    • Select your app target
    • Go to Signing & Capabilities
    • Click + Capability and add Push Notifications
  2. Enable Background Modes:
    • Add Background Modes capability
    • Enable Remote notifications
  3. Configure APNs certificates in your Apple Developer account and upload them to Zixflow dashboard.

Notification Service Extension

To support rich push notifications (images, videos, action buttons), you need to add a Notification Service Extension:
  1. Create a Notification Service Extension in Xcode:
    • File > New > Target > Notification Service Extension
    • Name it NotificationServiceExtension
  2. Add Zixflow modules to the extension in your Podfile:
target 'NotificationServiceExtension' do
  pod "ZixflowMessagingPushAPN", "~> 1.1"
  pod "ZixflowMessagingPush", "~> 1.1"
  pod "ZixflowDataPipelines", "~> 1.1"
  pod "ZixflowCommon", "~> 1.1"
  pod "AnalyticsSwiftZixflow", "1.7.3+zixflow.1"
end
  1. Update NotificationService.swift:
import UserNotifications
import ZixflowMessagingPushAPN

class NotificationService: UNNotificationServiceExtension {
    var contentHandler: ((UNNotificationContent) -> Void)?
    var bestAttemptContent: UNMutableNotificationContent?

    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
        self.contentHandler = contentHandler
        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)

        // Use Zixflow to handle rich push
        MessagingPushAPN.didReceive(request, withContentHandler: contentHandler)
    }

    override func serviceExtensionTimeWillExpire() {
        if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
            contentHandler(bestAttemptContent)
        }
    }
}
  1. Run pod install again to install extension dependencies.