Before Getting Started

Overview

Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users.

Environment

  • Xcode 16.2 or later
  • Cocoapods or Swift Package Manager
Make sure you’ve completed the Firebase setup.If the setup is complete, the following items should be in place.
  1. Make sure GoolgeServies-Info.plist is in your project directory.
  2. Upload the Service Account Key file to the Clix console.
Clix provides a Homebrew CLI for quick and easy setup. Use the install and doctor commands to automatically configure the required code and settings. For iOS projects, follow the CLI prompts to add the necessary files and configurations.

Install Clix CLI

brew tap clix-so/clix-cli
brew install clix-so/clix-cli/clix

Run Install Command

The install command in the Clix CLI checks for required files and configurations, and provides appropriate installation guidance through prompts.
clix install

Doctor Command

The clix doctor command checks whether the necessary code and configuration for using the Clix SDK are properly set up, and provides guidance on how to fix any issues.
clix doctor

Setup Clix - Manual Installation

Integrate Firebase and Clix to manage and send notifications effectively from Clix console.
GitHub release (latest by date)

1. Add Firebase SDK & Clix SDK

2. Add Capability and Initialization Code

3. Build & Run

4. Add App Extension

5. Add App Grooup & Clix Package

6. Initialize Clix in App Extension

7. Build & Run

Post-installation Checklist

After installing and wiring the SDK, review the following critical points to avoid subtle runtime issues and ensure Clix can manage push notifications correctly.
import UIKit
import Clix
import FirebaseCore

class AppDelegate: ClixAppDelegate {
    override func application(_ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        // 1. Always configure Firebase first
        FirebaseApp.configure()

        // 2. Then initialize Clix (async-safe)
        Task {
            await Clix.initialize(
                config: ClixConfig(
                    projectId: YOUR_PROJECT_ID,
                    apiKey: YOUR_PUBLIC_API_KEY
                )
            )
        }

        // 3. Return super at the very end (lets Clix finalize delegates & observers)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}
Initialize Clix after FirebaseApp.configure() Reason: Clix relies on Firebase Messaging. If Firebase isn’t configured first, FCM token retrieval and registration can fail.
Call super at the very end of each overridden lifecycle method inherited from ClixAppDelegate / ClixNotificationServiceExtension Reason: Clix’s super implementation finalizes delegate setup, event tracking, and background handling. Calling it early can overwrite or miss your custom logic; omitting it breaks internal hooks.
Remove manual assignments to Messaging.messaging().delegate and UNUserNotificationCenter.current().delegate Reason: Clix sets these delegates internally. Reassigning them can prevent delivery receipts, media attachment handling, or token sync.
If you must implement your own delegate methods (e.g., for foreground presentation), do it in your AppDelegate subclass but still avoid reassigning the delegates. Clix forwards relevant delegate callbacks so your overrides continue to work.
Need to confirm things are correct? Run clix doctor again — it re-validates configuration and highlights missing steps.

Quick Self-Test

  1. Launch the app cold start: verify no console errors about FCM or missing projectId.
  2. Send a test push: confirm receipt and event tracking in the Clix Console (real-time events panel).
  3. Foreground push: ensure notification presentation logic still works without manual delegate assignments.
If any step fails, re-check the checklist above before deeper debugging.