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.
- Make sure GoolgeServies-Info.plist is in your project directory.
- Upload the Service Account Key file to the Clix console.
Setup Clix - Using CLI (Recommended)
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
Run Install Command
The install command in the Clix CLI checks for required files and configurations, and provides appropriate installation guidance through prompts.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.Setup Clix - Manual Installation
Integrate Firebase and Clix to manage and send notifications effectively from
Clix console.
1. Add Firebase SDK & Clix SDK
1. Add Firebase SDK & Clix SDK
Option1) Using Swift Package Manager (SPM):
Option2) Using Pod:
- Go to ‘File’ > ‘Add Package Dependencies’
- Search and add ‘https://github.com/clix-so/clix-ios-sdk.git’
- Install the package and select your main app as a target.
Option2) Using Pod:
- Add these lines to your
Podfile:
- Then run:
2. Add Capability and Initialization Code
2. Add Capability and Initialization Code
To add Push Notification Capability,
- Select your app target.
- Go to the Signing & Capabilities tab.
- Click the + button and choose Push Notification from the list.
AppDelegate.swift inside the didFinishLaunchingWithOptions method:Ensure that your AppDelegate inherits from ClixAppDelegate.
3. Build & Run
3. Build & Run
Run your project to verify the setup works correctly. Notifications should appear on your device as expected.
4. Add App Extension
4. Add App Extension
- Create a Notification Service Extension to enhance your notification content.
- In Xcode, choose File > New > Target > Notification Service Extension.
- Name the extension ‘ClixNotificationExtension’.
5. Add App Grooup & Clix Package
5. Add App Grooup & Clix Package
- Select your app target.
- Go to the Signing & Capabilities tab.
- Click the + button and choose App Groups from the list.
-
Click + under App Groups and create the App Group ID
The App Group ID must be ‘group.clix.YOUR_PROJECT_ID’
- Add the same App Group Id to the Extension target.
- At the Extension target > ‘General’ > ‘Frameworks, Libraries …’ , click ’+’ buton and search and add ‘Cllix’ to your extension target.
6. Initialize Clix in App Extension
6. Initialize Clix in App Extension
Add the following to your extension’s
NotificationService.swift:Note that you have to replace YOUR_PROJECT_ID to your own project id. (Check out Clix Console > Setting)
7. Build & Run
7. Build & Run
Run your project to verify the setup works correctly. Go to Clix console > Test Console, find the registered device, send a push message, and check if the message is received properly on the device. Also, make sure the push events are being tracked in real time.
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.
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
- Launch the app cold start: verify no console errors about FCM or missing projectId.
- Send a test push: confirm receipt and event tracking in the Clix Console (real-time events panel).
- Foreground push: ensure notification presentation logic still works without manual delegate assignments.