### Install Clix CLI - Shell Script Source: https://docs.clix.so/sdk-quickstart-android Installs the Clix CLI tool by downloading and executing an installation script from the provided URL. This is an alternative method for setting up the CLI. ```bash curl -fsSL https://cli.clix.so/install.sh | bash ``` -------------------------------- ### Install Clix CLI - npm Source: https://docs.clix.so/sdk-quickstart-android Installs the Clix CLI tool globally using npm. This command is the first step in setting up the Clix SDK for Android development. ```bash npm install -g @clix-so/clix-cli ``` -------------------------------- ### Install Clix CLI - Homebrew Source: https://docs.clix.so/sdk-quickstart-android Installs the Clix CLI using Homebrew package manager. This command first taps the Clix CLI repository and then installs the 'clix' package. ```bash brew tap clix-so/clix-cli && brew install clix ``` -------------------------------- ### Run Flutter Application Source: https://docs.clix.so/sdk-quickstart-flutter Build and run your Flutter application on a device or simulator after completing the setup steps. ```bash flutter run ``` -------------------------------- ### Initialize Clix SDK (Android) Source: https://docs.clix.so/mcp-server/integrating-clix-sdks-with-mcp This snippet demonstrates the process of initializing the Clix SDK within an Android application. It involves searching documentation for quickstart setup and SDK methods for configuration. The initialization typically occurs in the Application class's onCreate() method, after Firebase initialization. ```kotlin import com.clix.sdk.ClixConfig import com.clix.sdk.Clix import com.google.firebase.FirebaseApp // ... inside Application.onCreate() FirebaseApp.initializeApp(this) val config = ClixConfig.Builder() .setApiKey("YOUR_API_KEY") // Replace with your actual API key .setProjectId("YOUR_PROJECT_ID") // Replace with your actual Project ID .build() Clix.initialize(this, config) ``` -------------------------------- ### Install Clix Flutter SDK Dependencies Source: https://docs.clix.so/sdk-quickstart-flutter Add the Clix Flutter SDK, Firebase Core, and Firebase Messaging dependencies to your `pubspec.yaml` file. After adding the dependencies, run `flutter pub get` to install them. ```yaml dependencies: clix_flutter: ^0.0.1 firebase_core: ^3.6.0 firebase_messaging: ^15.1.3 ``` -------------------------------- ### Start Live Activities Source: https://docs.clix.so/api-reference/endpoint/live-activities%3Astart Initiates iOS Live Activities on one or more user devices using Push to Start. ```APIDOC ## POST /websites/clix_so/live_activities ### Description This endpoint starts iOS Live Activities on one or more user devices using Push to Start. ### Method POST ### Endpoint /websites/clix_so/live_activities ### Parameters #### Query Parameters - **device_tokens** (array[string]) - Required - A list of device tokens to send the push notification to. - **push_to_start_token** (string) - Required - The token generated by the user's device for Push to Start. - **activity_data** (object) - Required - The data payload for the Live Activity. - **key1** (string) - Description for key1 - **key2** (number) - Description for key2 ### Request Example ```json { "device_tokens": ["token1", "token2"], "push_to_start_token": "push_token_abc123", "activity_data": { "key1": "value1", "key2": 123 } } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the Live Activity was started. #### Response Example ```json { "message": "Live Activity started successfully" } ``` ### Error Responses #### 400 Bad Request Returned when the request contains invalid live activity parameters. Returns a plain text error message: ``` Invalid live activity parameters ``` #### 401 Unauthorized Authentication failed or invalid API key. ``` -------------------------------- ### POST /api/v1/live-activities:start Source: https://docs.clix.so/api-reference/endpoint/live-activities%3Astart Starts iOS Live Activities on one or more user devices using Push to Start. This endpoint is used to initiate live activities and requires detailed information about the target devices and the activity attributes. ```APIDOC ## POST /api/v1/live-activities:start ### Description This endpoint starts iOS Live Activities on one or more user devices using Push to Start. ### Method POST ### Endpoint https://api.clix.so/api/v1/live-activities:start ### Parameters #### Request Body - **live_activities** (array) - Required - List of live activities to start. Each item should conform to the `clixexternalv1LiveActivity` schema. ### Request Example ```json { "live_activities": [ { "target": { "project_user_id": "user123" }, "attributes_type": "DeliveryAttributes", "attributes": { "orderID": "#12345", "estimatedDeliveryTime": "2023-10-27T10:00:00Z" }, "content_state": { "driverName": "John Doe", "driverDistance": "5 miles" }, "alert": { "title": "Delivery Update", "body": "Your order is on its way!" } } ] } ``` ### Response #### Success Response (200) - **delivery_results** (array) - List of delivery results for each live activity. Each item should conform to the `clixexternalv1DeliveryResult` schema. #### Response Example ```json { "delivery_results": [ { "message_id": "msg_abc123", "status": "DELIVERED", "additional_params": { "device_token": "abcdef123456" } } ] } ``` #### Error Response (400) - **Error Message** (string) - Bad request - invalid parameters ### Schema Definitions #### v1StartLiveActivitiesRequest Request schema for starting live activities. - **live_activities** (array) - Required - List of live activities to start. - **items** (object) - Represents a single live activity. - **target** (object) - Required - Target device and/or user for the live activity. - **oneOf**: - **project_user_id** (string) - Project-specific user ID for targeting. - **device_id** (string) - ID of the target device. - **user_id** (string) - ID of the target user. - **attributes_type** (string) - Required - The name of the ActivityAttributes type defined in your iOS app (e.g., 'DeliveryAttributes'). - **attributes** (object) - Required - Initial values for ActivityAttributes (static data that doesn't change). - **content_state** (object) - Required - Initial values for ContentState (dynamic data that updates in real-time). - **alert** (object) - Optional - Push notification alert displayed when the Live Activity starts. #### v1StartLiveActivitiesResponse Response schema containing the delivery results for each live activity. - **delivery_results** (array) - List of delivery results for each live activity. - **items** (object) - Represents a delivery result. - **message_id** (string) - Unique ID of the push notification message. - **status** (string) - Delivery status of the push notification. - **additional_params** (object) - Additional parameters related to the delivery result. #### clixexternalv1LiveActivity A live activity to be started on a user device. - **target** (object) - Required - Target device and/or user for the live activity. - **attributes_type** (string) - Required - The name of the ActivityAttributes type defined in your iOS app. - **attributes** (object) - Required - Initial values for ActivityAttributes. - **content_state** (object) - Required - Initial values for ContentState. - **alert** (object) - Optional - Push notification alert. #### clixexternalv1DeliveryResult Result of a push notification delivery attempt. - **message_id** (string) - Unique ID of the push notification message. - **status** (string) - Delivery status of the push notification. - **additional_params** (object) - Additional parameters related to the delivery result. #### clixexternalv1LiveActivityTarget Target information for the live activity. - **oneOf**: - **project_user_id** (string) - Project-specific user ID for targeting. - **device_id** (string) - ID of the target device. - **user_id** (string) - ID of the target user. #### clixexternalv1LiveActivityAlert Alert notification displayed when starting a Live Activity. - **title** (string) - The title of the alert. - **body** (string) - The body text of the alert. ``` -------------------------------- ### Install Pods via Terminal Source: https://docs.clix.so/sdk-ios-nse This command installs the dependencies specified in the `Podfile`, including the Clix SDK. It requires navigating to the `ios` directory of your project. Ensure you open the `.xcworkspace` file after installation. ```bash cd ios pod install ``` -------------------------------- ### Configure Podfile and Install Dependencies Source: https://docs.clix.so/mcp-server/integrating-clix-sdks-with-mcp Add Clix SDK dependencies to your Podfile and run 'pod install'. This ensures all necessary libraries are downloaded and linked to your iOS project. ```bash cd ios && pod install ``` -------------------------------- ### Install Clix CLI using npm, bun, curl, or Homebrew Source: https://docs.clix.so/clix-cli Instructions for installing the Clix CLI globally using different package managers and shell commands. Ensure Node.js 20+ is installed. ```bash npm install -g @clix-so/clix-cli ``` ```bash bun add -g @clix-so/clix-cli ``` ```shell curl -fsSL https://cli.clix.so/install.sh | bash ``` ```bash brew tap clix-so/clix-cli && brew install clix ``` -------------------------------- ### Incorrect AppDelegate Initialization Order (Swift) Source: https://docs.clix.so/sdk-quickstart-ios Demonstrates common mistakes in AppDelegate setup, such as initializing Clix before Firebase or calling the superclass method too early. These errors can lead to FCM token retrieval failures or incomplete Clix delegate setup. ```swift FirebaseApp.configure() // ❌ Missing (or comes after Clix) Task { await Clix.initialize(config: /* ... */) } // Will fail if Firebase not ready ``` ```swift override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ...) -> Bool { let ok = super.application(application, didFinishLaunchingWithOptions: launchOptions) // ❌ super too early FirebaseApp.configure() Task { await Clix.initialize(config: /* ... */) } return ok } ``` ```swift import FirebaseMessaging import UserNotifications override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ...) -> Bool { FirebaseApp.configure() // ❌ Remove these. ClixAppDelegate manages them internally. UNUserNotificationCenter.current().delegate = self Messaging.messaging().delegate = self return super.application(application, didFinishLaunchingWithOptions: launchOptions) } ``` -------------------------------- ### Add Clix and Firebase SDKs via CocoaPods Source: https://docs.clix.so/sdk-quickstart-ios Instructions for adding the Clix SDK and Firebase Messaging to your project using CocoaPods. This involves updating your Podfile with the necessary pod entries and running the 'pod install' command. ```bash # Podfile pod 'Firebase/Messaging' pod 'ClixSDK' ``` -------------------------------- ### Create Swift Helper for Live Activity Setup in React Native AppDelegate.mm Source: https://docs.clix.so/live-activity This Swift code defines a helper class `LiveActivitySetup` to encapsulate the Live Activity setup logic for React Native apps using `AppDelegate.mm`. It ensures the `DeliveryAttributes` are registered for iOS 16.1+. ```swift import Foundation import clix_react_native_sdk @objc public class LiveActivitySetup: NSObject { @objc public static func setup() { if #available(iOS 16.1, *) { ClixLiveActivity.setup(DeliveryAttributes.self) } } } ``` -------------------------------- ### Live Activities API Source: https://docs.clix.so/api-reference/openapi Endpoint for starting iOS Live Activities on user devices using Push to Start. ```APIDOC ## POST /api/v1/live-activities:start ### Description Starts iOS Live Activities on one or more user devices using Push to Start. Requires a request body containing the live activities to start. ### Method POST ### Endpoint /api/v1/live-activities:start ### Parameters #### Request Body - **request** (object) - Required - Request body containing the live activities to start. - **activity_id** (string) - Required - Unique identifier for the live activity. - **user_ids** (array of strings) - Required - List of user IDs to start the live activity for. - **payload** (object) - Required - Data payload for the live activity. ### Request Example ```json { "activity_id": "your_activity_id", "user_ids": ["user123", "user456"], "payload": { "content_state": { "event_name": "Game Started", "score": "0-0" }, "flicker": true } } ``` ### Response #### Success Response (200) - **delivery_results** (array of objects) - Results of the delivery for each live activity. - **user_id** (string) - The ID of the user. - **status** (string) - The status of the live activity delivery (e.g., "success", "failed"). - **error_message** (string) - Error message if the delivery failed. #### Response Example ```json { "delivery_results": [ { "user_id": "user123", "status": "success" }, { "user_id": "user456", "status": "failed", "error_message": "Invalid push token" } ] } ``` ``` -------------------------------- ### Install Pods (React Native CLI) Source: https://docs.clix.so/sdk-quickstart-react-native Navigates to the ios directory and installs CocoaPods dependencies using 'pod install'. This command is essential after modifying the Podfile to update the native iOS project. ```bash cd ios && pod install && cd .. ``` -------------------------------- ### Correct AppDelegate Initialization Order (Swift) Source: https://docs.clix.so/sdk-quickstart-ios Ensures Firebase is configured before Clix initialization and that the superclass method is called last. This prevents runtime issues related to Firebase dependencies and allows Clix to finalize its setup. ```swift 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) } } ``` -------------------------------- ### Call Swift Live Activity Setup Helper in React Native AppDelegate.mm Source: https://docs.clix.so/live-activity This Objective-C code snippet shows how to call the `LiveActivitySetup.swift` helper from your React Native application's `AppDelegate.mm` file. This integrates the Live Activity setup into the main app launch process. ```objectivec #import "AppDelegate.h" #import ``` -------------------------------- ### Configure Firebase and Live Activity Setup in AppDelegate (Objective-C) Source: https://docs.clix.so/live-activity This snippet shows how to configure Firebase and register for Live Activities within the `AppDelegate` of an iOS application. It requires Firebase SDK and the Clix SDK. The `didFinishLaunchingWithOptions` method is the entry point for this setup. ```objective-c #import // Import Swift bridging header #import "YourApp-Swift.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; self.moduleName = @"YourApp"; self.initialProps = @{}; // Register Live Activity [LiveActivitySetup setup]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } // ... rest of AppDelegate @end ``` -------------------------------- ### Request Notification Permission - Kotlin Source: https://docs.clix.so/sdk-quickstart-android This code snippet demonstrates how to request notification permission from the user at a specific point in your Android application. It uses `lifecycleScope.launch` to perform the asynchronous operation and `Clix.Notification.requestPermission()` to get the permission status, which is then set using `Clix.Notification.setPermissionGranted()`. Ensure the Clix SDK is properly integrated into your project. ```kotlin import androidx.lifecycle.lifecycleScope import kotlinx.coroutines.launch class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Call this code wherever you want to request permission from the user lifecycleScope.launch { val granted = Clix.Notification.requestPermission() Clix.Notification.setPermissionGranted(granted) } } } ``` -------------------------------- ### Start Live Activities API Source: https://docs.clix.so/api-reference/openapi Initiates live activities on user devices. This endpoint allows you to send real-time updates to users through live activities integrated into their devices. ```APIDOC ## POST /v1/liveActivities ### Description Starts one or more live activities on target devices. Each live activity includes targeting information, attribute types, initial attribute values, and optional content state and alert notifications. ### Method POST ### Endpoint /v1/liveActivities ### Parameters #### Request Body - **live_activities** (array) - Required - List of live activities to start. Each item must conform to the `clixexternalv1LiveActivity` schema. ### Request Example ```json { "live_activities": [ { "target": { "project_user_id": "user123" }, "attributes_type": "DeliveryAttributes", "attributes": { "orderId": "ORD-987", "estimatedDeliveryTime": "2023-10-27T10:00:00Z" }, "content_state": { "driverName": "Alice", "driverLocation": "123 Main St" }, "alert": { "title": "Delivery Update", "body": "Your order is on its way!" } } ] } ``` ### Response #### Success Response (200) - **delivery_results** (array) - List of delivery results for each live activity started. Each item contains the status and details for a specific live activity. #### Response Example ```json { "delivery_results": [ { "device_id": "deviceabc", "status": "Success", "error_code": null, "error_message": null } ] } ``` ### Schema Details #### clixexternalv1LiveActivity - **target** (object) - Required - Target device and/or user for the live activity. See `clixexternalv1LiveActivityTarget`. - **attributes_type** (string) - Required - The name of the ActivityAttributes type defined in your iOS app (e.g., 'DeliveryAttributes'). - **attributes** (object) - Required - Initial values for ActivityAttributes (static data that doesn't change). Accepts additional properties. - **content_state** (object) - Optional - Initial values for ContentState (dynamic data that updates in real-time). Accepts additional properties. - **alert** (object) - Optional - Push notification alert displayed when the Live Activity starts. If not provided, defaults to title: 'Live Activity', body: 'Started'. See `clixexternalv1LiveActivityAlert`. #### clixexternalv1LiveActivityTarget - **project_user_id** (string) - Required if `device_id` and `user_id` are not present - Project-specific user ID for targeting. - **device_id** (string) - Required if `project_user_id` and `user_id` are not present - ID of the target device. - **user_id** (string) - Required if `project_user_id` and `device_id` are not present - ID of the target user. #### clixexternalv1LiveActivityAlert - **title** (string) - Optional - The title of the alert notification. - **body** (string) - Optional - The body text of the alert notification. ``` -------------------------------- ### Install Clix SDK into project Source: https://docs.clix.so/clix-cli Command to automatically install and configure the Clix SDK for your project. The CLI detects the platform (iOS, Android, React Native, Flutter) and applies necessary changes. ```bash clix install ``` -------------------------------- ### Notification Service Extension Setup Source: https://docs.clix.so/mcp-server/integrating-clix-sdks-with-mcp Create a NotificationService.swift file for your Notification Service Extension. This file handles incoming remote notifications before they are delivered to the user. ```swift // Placeholder for NotificationService.swift content // This code should be generated based on search_sdk("NotificationService ClixNotificationServiceExtension", platform="ios") import UserNotifications import Clix class NotificationService: ClixNotificationServiceExtension { override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { super.didReceive(request, withContentHandler: contentHandler) // Custom notification handling logic can be added here } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated due to its deadline. // You must call the completionHandler object at the end of your implementation. super.serviceExtensionTimeWillExpire() } } ``` -------------------------------- ### Build and Run App for Expo Source: https://docs.clix.so/sdk-quickstart-react-native Commands to prebuild native code and run the application on Android and iOS simulators/devices after installing the Clix SDK in an Expo project. ```bash npx expo prebuild --clean npx expo run:android npx expo run:ios ``` -------------------------------- ### Example Multi-Group Audience Logic (Pseudocode) Source: https://docs.clix.so/campaigns/audience Illustrates a more complex audience structure involving multiple groups with different logical connectors (OR and AND). This example shows how to combine country-based targeting with app version requirements. ```pseudocode Group 1 country equals "KR" OR country equals "JP" AND Group 2 app_version greater than or equal "3.2.0" ``` -------------------------------- ### Build and Run App for React Native CLI Source: https://docs.clix.so/sdk-quickstart-react-native Commands to build and run your React Native application on Android and iOS devices or simulators after installing the Clix SDK. ```bash npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Install Clix MCP Server for AI agent Source: https://docs.clix.so/clix-cli Installs the Clix MCP Server associated with a specific AI agent, enabling real-time access to Clix documentation and SDK code examples. Requires Clix CLI installation. ```bash clix install-mcp cursor ``` -------------------------------- ### Launch Clix CLI interactive chat Source: https://docs.clix.so/clix-cli Command to start the interactive AI chat interface for the Clix CLI. This requires the Clix CLI to be installed. ```bash clix ``` -------------------------------- ### Example API Request (Bash) Source: https://docs.clix.so/api-reference/overview Demonstrates how to make a POST request to the Clix API to create a user. It includes the necessary headers for authentication (Project ID and API Key) and the JSON payload for the user data. Ensure to replace placeholders with your actual project ID and secret API key. ```bash curl -X POST https://api.clix.so/api/v1/users \ -H "X-Clix-Project-ID: your_project_id" \ -H "X-Clix-API-Key: your_secret_api_key" \ -H "Content-Type: application/json" \ -d '{ "user": { "project_user_id": "user_123" } }' ``` -------------------------------- ### Install Clix MCP Server using Claude Code CLI (Bash) Source: https://docs.clix.so/mcp-server/clix-mcp-server These bash commands are used to register the Clix MCP Server with the Claude Code CLI. The first command adds the server directly, while the second installs it via the plugin marketplace, offering flexibility in setup. ```bash claude mcp add --transport stdio clix-mcp-server -- npx -y @clix-so/clix-mcp-server@latest ``` ```bash /plugin marketplace add clix-so/clix-mcp-server ``` -------------------------------- ### Initialize Clix SDK in Android Application Source: https://docs.clix.so/sdk-quickstart-android This code snippet shows how to initialize the Clix SDK within your Android `Application` class. It requires your project ID and API key. The `endpoint` and `logLevel` parameters are optional. ```kotlin import so.clix.core.Clix import so.clix.core.ClixConfig import so.clix.utils.logging.ClixLogLevel class MyApplication : Application() { override fun onCreate() { super.onCreate() Clix.initialize( this, ClixConfig( projectId = "YOUR_PROJECT_ID", apiKey = "YOUR_API_KEY", ), ) } } ``` -------------------------------- ### Initialize Clix SDK in AppDelegate (Swift) Source: https://docs.clix.so/sdk-quickstart-ios Code snippet for initializing the Clix SDK within the `didFinishLaunchingWithOptions` method of your AppDelegate. This requires importing Clix and FirebaseCore, configuring Firebase, and calling `Clix.initialize` with your project and API keys. Ensure your AppDelegate inherits from ClixAppDelegate. ```swift import UIKit import Clix import FirebaseCore class AppDelegate: ClixAppDelegate { override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() Task { await Clix.initialize( config: ClixConfig( projectId: YOUR_PROJECT_ID, apiKey: YOUR_PUBLIC_API_KEY ) ) } ``` -------------------------------- ### Enable Live Activities in Info.plist Source: https://docs.clix.so/live-activity This snippet shows how to enable Live Activities by adding the `NSSupportsLiveActivities` key to your application's Info.plist file. This is a prerequisite for using Live Activities. ```xml NSSupportsLiveActivities ``` -------------------------------- ### Setup Live Activity in React Native AppDelegate.swift Source: https://docs.clix.so/live-activity This code demonstrates how to set up Live Activities in a React Native application using `AppDelegate.swift`. It integrates with Firebase and the `clix_react_native_sdk`, registering the `DeliveryAttributes` for Live Activity support on iOS 16.1+. ```swift import UIKit import Firebase import clix_react_native_sdk @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() // Register Live Activity attributes type (iOS 16.1+) if #available(iOS 16.1, *) { ClixLiveActivity.setup(DeliveryAttributes.self) } return true } // ... rest of AppDelegate } ``` -------------------------------- ### Install Clix Dependencies for Expo Source: https://docs.clix.so/sdk-quickstart-react-native Installs the Clix SDK and necessary dependencies for Expo projects. Ensure version compatibility with your React Native version for react-native-get-random-values and react-native-mmkv. ```bash npx expo install @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values react-native-mmkv react-native-nitro-modules uuid@11.1.0 ``` -------------------------------- ### Add Clix Android SDK Dependency Directly (Gradle Kotlin DSL) Source: https://docs.clix.so/sdk-quickstart-android This snippet demonstrates how to add the Clix Android SDK dependency directly in your project's build files without using a Version Catalog. It includes configuring repositories and adding the dependency and necessary plugins to your app's `build.gradle.kts`. ```kotlin repositories { mavenCentral() } dependencies { implementation("so.clix:clix-android-sdk:1.X.X") // Replace with the latest SDK version } plugins { id("com.google.gms.google-services") version "4.X.X" // Replace with the latest version } ``` -------------------------------- ### Install Expo Dev Client Source: https://docs.clix.so/sdk-quickstart-react-native Installs the expo-dev-client package, which is required for Expo projects to enable platform-native features like push notifications when using React Native Firebase. ```bash npx expo install expo-dev-client ``` -------------------------------- ### Install React Native Firebase Core (CLI) Source: https://docs.clix.so/sdk-quickstart-react-native Installs the core React Native Firebase modules (@react-native-firebase/app, @react-native-firebase/messaging) for React Native CLI projects using either npm or yarn. ```bash npm install @react-native-firebase/app @react-native-firebase/messaging # or yarn add @react-native-firebase/app @react-native-firebase/messaging ``` -------------------------------- ### Install React Native Firebase Core (Expo) Source: https://docs.clix.so/sdk-quickstart-react-native Installs the core React Native Firebase modules (@react-native-firebase/app, @react-native-firebase/messaging) and expo-build-properties for Expo projects. This step is crucial for integrating Firebase services. ```bash npx expo install @react-native-firebase/app @react-native-firebase/messaging expo-build-properties ``` -------------------------------- ### Create Webhook Source: https://docs.clix.so/integrations/webhook This section details the process of creating a new webhook, including the necessary fields and configurations. ```APIDOC ## POST /websites/clix_so/webhooks ### Description Creates a new webhook to receive push notification events. ### Method POST ### Endpoint /websites/clix_so/webhooks ### Parameters #### Request Body - **webhook_name** (string) - Required - A descriptive name for the webhook. - **triggers** (array of strings) - Required - Events that trigger the webhook. Possible values: "Sent", "Failed". - **http_configuration** (object) - Required - Configuration for the HTTP request. - **method** (string) - Required - HTTP method, currently only "POST" is supported. - **webhook_url** (string) - Required - The HTTPS URL endpoint to send webhook data to. - **timeout_ms** (integer) - Optional - Maximum time in milliseconds to wait for a response. Defaults to 5000. - **custom_headers** (object) - Optional - Custom HTTP headers to include in the request. ### Request Example ```json { "webhook_name": "Production Analytics Webhook", "triggers": ["Sent", "Failed"], "http_configuration": { "method": "POST", "webhook_url": "https://your-analytics-service.com/webhook", "timeout_ms": 10000 }, "custom_headers": { "Authorization": "Bearer YOUR_API_KEY" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the webhook was created successfully. #### Response Example ```json { "message": "Webhook 'Production Analytics Webhook' created successfully." } ``` ``` -------------------------------- ### Install Clix Dependencies for React Native CLI Source: https://docs.clix.so/sdk-quickstart-react-native Installs the Clix SDK and required dependencies for React Native CLI projects using npm or yarn. Pay attention to version compatibility for react-native-get-random-values and react-native-mmkv based on your React Native version. ```bash npm install @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values@^1.11.0 react-native-mmkv react-native-nitro-modules uuid@11.1.0 # or yarn add @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values@^1.11.0 react-native-mmkv react-native-nitro-modules uuid@11.1.0 ``` -------------------------------- ### Example Custom Properties for Personalization Source: https://docs.clix.so/api-reference/endpoint/campaigns%3Atrigger An example of a JSON object representing custom properties that can be passed to a campaign trigger. These properties are used for message personalization within templates (e.g., `{{ trigger.property_name }}`) and dynamic audience filtering. ```json { "name": "John Doe", "age": 40, "is_premium_user": true, "state": "CA", "city": "Mountain View" } ``` -------------------------------- ### Add Clix Android SDK Dependency via Version Catalog (Gradle Kotlin DSL) Source: https://docs.clix.so/sdk-quickstart-android This snippet shows how to add the Clix Android SDK dependency to your project using Gradle's Version Catalog. It involves updating the `libs.versions.toml` file with the SDK version and library alias, and then referencing it in your app module's `build.gradle.kts`. ```toml [versions] clix-android-sdk = "1.X.X" # Replace with the latest SDK version [libraries] clix-android-sdk = { module = "so.clix:clix-android-sdk", version.ref = "clix-android-sdk" } ``` ```kotlin dependencies { // TOML alias: clix-android-sdk -> Gradle accessor: libs.clix.android.sdk implementation(libs.clix.android.sdk) } ``` -------------------------------- ### Trigger Campaign Request Body Examples Source: https://docs.clix.so/api-reference/endpoint/campaigns%3Atrigger Examples of JSON request bodies for triggering API- campaigns. These demonstrate how to specify the audience (broadcast or targeted users) and pass custom properties for personalization or dynamic filtering. ```json { "audience": { "broadcast": true }, "properties": { "promotion": "Holiday Sale", "discount": "30%" } } ``` ```json { "audience": { "broadcast": false, "targets": [ { "project_user_id": "clix_user_a" }, { "project_user_id": "clix_user_b" } ] }, "properties": { "subscription_plan": "premium", "message_type": "transactional" } } ``` ```json { "properties": { "campaign_variant": "A" } } ```