Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions llms.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- repo: clix-so/clix-android-sdk -->
<!-- ref: main -->
<!-- commit: 18f55d0c061fc895a3c533280675731b715260d9 -->
<!-- generated_at: 2025-12-17T05:03:30Z -->
<!-- commit: 46845ed3c7bb29e78897cada2059df749cc4cdf7 -->
<!-- generated_at: 2026-02-19T10:16:02Z -->
# Platform: Android

## /
- [Build.gradle](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/build.gradle.kts): Top-level Gradle build script configuring shared Android/Kotlin/ktfmt/GMS plugins (without applying them) and enforcing a specific `commons-compress` version via the `classpath` configuration’s resolution strategy for all modules in the SDK.
- [Settings.gradle](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/settings.gradle.kts): Defines Gradle plugin and dependency repositories, enforces centralized repository resolution, sets the root project name `clix-android-sdk`, and includes the `:clix` SDK module and `:samples:basic-app` sample app modules in the build.
- [Gradle](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/gradle.properties): Defines project-wide Gradle configuration for the SDK, including JVM args, AndroidX usage, Kotlin code style, and non-transitive R class behavior that affects build performance, resource namespacing, and compatibility across all modules.
- [Readme](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/README.md): README.md documents installation and Firebase setup, SDK initialization (Clix.
- [Changelog](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/CHANGELOG.md): Changelog documenting semver releases and dates, enumerating SDK changes such as ClixConfig initialization, coroutine/thread-safe singletons, Clix.Notification/ClixMessagingService FCM integration and foreground/background handler behavior, user/property APIs, event tracking, serialization fixes, logging, and bug fixes.
- [Changelog](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/CHANGELOG.md): CHANGELOG documenting SDK semantic-versioned release history, API additions/behavioral changes (e.g.
- [License](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/LICENSE): Defines the SDK’s licensing terms as a modified MIT license, permitting use, modification, and distribution only when integrated with Clix services and requiring inclusion of copyright and permission notices in all substantial copies.

## clix
Expand All @@ -18,8 +18,8 @@
## clix/src/main/kotlin/so/clix/core
- [Clixnotification](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/ClixNotification.kt): ClixNotification is a singleton that configures push behavior (configure/autoRequestPermission/autoHandleLandingURL), exposes handler APIs (onMessage, onBackgroundMessage, onNotificationOpened, onFcmTokenError), manages FCM token/permission ops, and routes payloads to Clix services and optional landing URLs.
- [Clixenvironment](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/ClixEnvironment.kt): Serializable internal ClixEnvironment constructs and serializes ClixDevice from Context/config/deviceId/token (collecting appVersion, advertising ID via reflection, push permission, timezone/locale), exposes synchronized getDevice/setDevice and companion helpers getAppVersion/getAdId/getIsPushPermissionGranted.
- [Clixconfig](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/ClixConfig.kt): Defines the serializable `ClixConfig` data class that centralizes SDK initialization settings (project ID, API key, API endpoint, `ClixLogLevel`, and extra HTTP headers) used to configure Clix network calls and logging behavior.
- [Clix](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/Clix.kt): Clix.kt defines the Clix singleton SDK entrypoint that initializes services (storage, token, device, event, notification), persists config, fetches/upserts FCM tokens asynchronously, exposes public APIs (initialize, user ID/properties, trackEvent, setLogLevel, getDeviceId) and Notification, and logs errors via ClixLogger.
- [Clixconfig](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/ClixConfig.kt): kotlinx.serialization-annotated ClixConfig data class encapsulating SDK configuration (projectId, apiKey, endpoint default https://api.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore full default endpoint in llms summary

This update truncates the ClixConfig description to endpoint default https://api., which is no longer accurate documentation of the SDK default (https://api.clix.so in clix/src/main/kotlin/so/clix/core/ClixConfig.kt). Because llms.txt is consumed by AI tooling and docs workflows, this can propagate an invalid endpoint into generated integration guidance and break setup instructions.

Useful? React with 👍 / 👎.

- [Clix](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/core/Clix.kt): Singleton Clix object initializes and manages SDK lifecycle (initialize(context, config) and auto-restore), coordinates Device/Token/Notification/Event/Storage/Session services, fetches/upserts FCM token asynchronously, and exposes Notification, reset, setUserId/Properties, trackEvent, setLogLevel, getDeviceId.

## clix/src/main/kotlin/so/clix/models
- [Notificationcontext](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/models/NotificationContext.kt): Internal data class NotificationContext encapsulating notificationData: Map<String, Any?> and autoOpenLandingURL flag (default true), used by notification-handling flows to decide whether to auto-open landing URLs; module-internal.
Expand All @@ -31,17 +31,18 @@
## clix/src/main/kotlin/so/clix/notification
- [Permissionactivity](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/notification/PermissionActivity.kt): Internal transparent PermissionActivity that requests POST_NOTIFICATIONS on Android TIRAMISU+, persists pending/result/timestamp in Clix.storageService to recover after restarts, exposes internal suspend requestPermission(context) which starts the activity, awaits result via a synchronized callback, and enforces a 5s timeout.
- [Clixmessagingservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/notification/ClixMessagingService.kt): Firebase MessagingService that auto-initializes Clix, parses FCM RemoteMessage into ClixPushNotificationPayload in onMessageReceived and dispatches to Clix.Notification via coroutine, and handles onNewToken by saving/upserting tokens (Clix.
- [Notificationtappedactivity](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/notification/NotificationTappedActivity.kt): Manifest-registered Activity that handles notification tap intents by extracting extras (messageId, landingUrl, journey IDs, autoHandleLandingURL, JSON data), deserializing data, and invoking ClixNotification.handleNotificationTapped (with NotificationContext and ClixPushNotificationPayload), then finishes.
- [Notificationtappedactivity](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/notification/NotificationTappedActivity.kt): Manifest-launched AppCompatActivity that handles notification-tap intents (onCreate/onNewIntent), parses extras (messageId, landingUrl, userJourneyId/userJourneyNodeId, NOTIFICATION_DATA_EXTRA), sets Clix.sessionService pendingMessageId, deserializes data and delegates to ClixNotification.

## clix/src/main/kotlin/so/clix/services
- [Notificationservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/NotificationService.kt): NotificationService (Context, StorageService, EventService) manages channels/permissions, deduplicates and shows push notifications (creates NotificationCompat notifications with optional remote image and PendingIntent to NotificationTappedActivity), tracks receive/tap events, and exposes handleNotificationReceived/tapped, requestNotificationPermission, preferences/reset.
- [Sessionservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/SessionService.kt): SessionService observes the app lifecycle to maintain session state, persisting last-activity in StorageService and starting a new session (async EventService.trackEvent via Clix.
- [Notificationservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/NotificationService.kt): NotificationService manages displaying push notifications (creates channel, builds NotificationCompat with optional BigPicture icon fetched via HTTP), tracks receipt/tap events via EventService, deduplicates via StorageService, handles permission requests, and exposes handleNotificationReceived/handleNotificationTapped/requestNotificationPermission/setNotificationPreferences/reset.
- [Storageservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/StorageService.kt): Provides a type-safe JSON-backed wrapper around Android `SharedPreferences` for internal SDK persistence, exposing generic `set<T>`, `get<T>`, and `remove` APIs using Kotlinx Serialization with `ignoreUnknownKeys` and logging deserialization failures via `ClixLogger`.
- [Deviceservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/DeviceService.kt): Manages device identity, local storage, and remote device/user-property synchronization via DeviceAPIService using StorageService and Clix.environment—providing getCurrentDeviceId(), set/remove project userId, update/remove user properties, upsert token and push-permission; logs and handles network/serialization errors.
- [Tokenservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/TokenService.kt): Internal TokenService (depends on StorageService) persists a timestamped Token at key "clix_current_push_token", maintains up to 5 previous tokens at "clix_push_tokens", and exposes getCurrentToken, getPreviousTokens, saveToken, clearTokens and reset.
- [Deviceapiservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/DeviceAPIService.kt): DeviceAPIService provides suspend REST client methods (post/delete via ClixAPIClient) to upsert devices, set a device's projectUserId, add/update or remove user properties—returning ClixServerDevice or projectUserId and serializing ClixDevice/ClixUserProperty to /devices and /devices/{id}/user/* endpoints.
- [Eventservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/EventService.kt): Internal service that converts arbitrary event properties to JSON primitives, builds `EventProperties`/`EventForRequest` payloads (including message/journey metadata and `Clix.environment.
- [Eventservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/EventService.kt): Internal EventService provides a suspend trackEvent that converts properties to JsonPrimitives (booleans, numbers, strings, dates via ClixDateFormatter), builds EventProperties with Clix.environment.
- [Clixapiclient](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/ClixAPIClient.kt): Defines the internal `ClixAPIClient`, a JSON-configured (snake_case) HTTP wrapper around `HTTPClient` that builds `/api/v1` URLs from `Clix` environment config, injects default auth/identification headers, logs requests/responses, and exposes generic suspend `get`, `post`, `put`, and `delete` helpers.
- [Eventapiservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/EventAPIService.kt): Implements the `/events` tracking client, defining serializable `Event*` payload models and using the generic `ClixAPIClient.post<CreateEventsRequest, CreateEventsResponse>` flow to send batched device-scoped events (with message/journey metadata and custom JSON properties) to the backend.
- [Eventapiservice](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/services/EventAPIService.kt): Defines internal kotlinx.serialization models for events (EventProperties, EventForRequest, Event, CreateEventsRequest/Response) and EventAPIService exposing suspend fun trackEvents() which POSTs events to '/events' via ClixAPIClient.

## clix/src/main/kotlin/so/clix/utils
- [Clixerror](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/utils/ClixError.kt): Defines the internal sealed `ClixError` exception hierarchy used across the SDK to represent initialization, configuration, network, encoding/decoding, permission, and unknown failures, standardizing error messages and propagation for Clix API flows.
Expand All @@ -58,15 +59,15 @@
- [Clixlogger](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/main/kotlin/so/clix/utils/logging/ClixLogger.kt): Defines the internal `ClixLogger` singleton that centralizes SDK logging by mapping `ClixLogLevel`-filtered debug/info/warn/error calls to Android’s `Log` API under a fixed tag, with a synchronized `setLogLevel` entry point controlling global verbosity.

## clix/src/test/kotlin/so/clix/core
- [Clixtest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/core/ClixTest.kt): Robolectric+MockK unit tests for the Clix singleton that verify SDK initialization, logging, user property/event APIs, device/token retrieval (including exception handling) and coroutine-backed service calls by mocking Device/Event/Token/Notification services, NotificationManagerCompat, and ClixLogger.
- [Clixtest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/core/ClixTest.kt): Unit tests for the Clix singleton verifying initialization and public APIs (initialize, setUserId, setUserProperty(s), trackEvent, setLogLevel, reset, getDeviceId, Notification.getToken), mocking services (Device/Event/Token/Notification/Session/Storage), ClixLogger, NotificationManagerCompat under Robolectric.
- [Clixconfigtest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/core/ClixConfigTest.kt): JUnit test suite validating `ClixConfig` initialization behavior, ensuring required fields, default endpoint/log level, and optional overrides (custom endpoint, `ClixLogLevel`, extraHeaders) are correctly applied using `assertEquals` against expected configuration state.

## clix/src/test/kotlin/so/clix/models
- [Clixuserpropertytest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/models/ClixUserPropertyTest.kt): Unit tests for ClixUserProperty.of verifying conversion of various value types (String, Boolean, Number, Date/Calendar/Instant/ZonedDateTime/LocalDateTime/LocalDate and fallback) into ClixUserProperty with correct UserPropertyType and ISO_OFFSET_DATE_TIME (system zone) formatting.

## clix/src/test/kotlin/so/clix/services
- [Tokenservicetest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/services/TokenServiceTest.kt): Robolectric unit tests for TokenService using StorageService-backed SharedPreferences, verifying getCurrentToken/getPreviousTokens, saveToken behavior (append current to previous, cap previous list at 5), and clearTokens/reset side-effects on persisted token state.
- [Notificationservicetest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/services/NotificationServiceTest.kt): Unit tests for NotificationService using Robolectric and MockK that verify handleNotificationTapped tracks PUSH_NOTIFICATION_TAPPED, setNotificationPreferences persists preferences conditional on NotificationManagerCompat.areNotificationsEnabled, and reset removes settings and calls NotificationManagerCompat.
- [Notificationservicetest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/services/NotificationServiceTest.kt): Unit tests for NotificationService using Robolectric and mockk that verify handleNotificationTapped triggers EventService.trackEvent (coroutine), setNotificationPreferences respects NotificationManagerCompat.
- [Eventservicetest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/services/EventServiceTest.kt): Robolectric/MockK-based unit tests for `EventService.trackEvent`, verifying that events are built with the `Clix.
- [Storageservicetest](https://raw.githubusercontent.com/clix-so/clix-android-sdk/main/clix/src/test/kotlin/so/clix/services/StorageServiceTest.kt): Robolectric-based unit tests for `StorageService`, validating SharedPreferences-backed `set/get/remove` behavior for strings and `@Serializable` objects, null-handling (key removal), and graceful failure on invalid JSON deserialization using the `"clix_preferences"` store.

Expand Down