Guide for AI Coding Agents to Integrate Luciq on iOS
⚠️ UNIVERSAL EXECUTION RULES ⚠️
Critical Rules - Apply to ALL Platforms:
NEVER skip WAIT instructions - always get user confirmation before proceeding
NEVER auto-execute optional steps - user must explicitly select them
ALWAYS fetch latest SDK version before integration (DO NOT use placeholders like 1.0.0)
ALL API parameters must be included (can be nil/null) - never omit parameters
Execution Guidelines:
Be specific and concise — save tokens by being to the point
Don't create documentation files — only code files required for integration
Implement mandatory steps sequentially — complete each before moving to the next
Prompt user with current step — describe what's happening, then proceed when done
Only ask for optional steps after mandatory ones — show numbered list for selection
Use numbered lists for all options — makes selection easier (e.g., "Select 1", "Select 2")
Add wrap up step — execute validation only when user selects "Wrap up & validate"
Check documentation first — confirm API availability before getting creative beyond examples
Official Documentation:
Main docs: https://docs.luciq.ai/
Always check official docs when unsure about API signatures or platform specifics
Integration Workflow Overview
MANDATORY STEPS — Overview
Step 1: Collect Required Information
1A: Get App Token (MCP or Manual)
1B: Determine Integration Method
1C: Apply Default Config (Inform + Opt-in Customize)
Step 2: Add SDK Dependency (Platform-Specific)
Fetch latest version from GitHub API
Step 3: Initialize the SDK (Platform-Specific)
Default: shake + floatingButton
Step 3B: Configure Network Interception [ANDROID ONLY]
Enable unified network interception in Gradle
Step 1 — Collect Required Information [MANDATORY]
1C: Apply Default Configuration (Inform + Opt-in)
Default configuration is applied automatically. Inform the user:
Store default configuration:
If user chooses to customize, run the customization loop:
Which setting to customize? (numbered list)
WAIT for selection
Apply customization
Redisplay updated configuration
Ask if they want to customize anything else — repeat until done
Step 2 — Add SDK Dependency [MANDATORY - iOS]
MUST FETCH LATEST VERSION FIRST: https://api.github.com/repos/luciqai/luciq-ios-sdk/releases/latest Extract version from "tag_name" (e.g., "19.1.0") and store it. DO NOT use placeholders like "1.0.0" or "latest".
If integration_method == spm (SPM - REQUIRED programmatic changes)
Important: When adding the SDK via SPM, you MUST update BOTH:
Package.swift
project.pbxproj
Xcode UI (manual) for reference:
File → Add Package Dependencies...
Enter URL: https://github.com/luciqai/luciq-ios-sdk
Select "Exact Version" and enter <FETCHED_VERSION>
Add "Luciq" product to your target
Programmatic changes (agent MUST modify project.pbxproj):
Add entries to PBXBuildFile, PBXFrameworksBuildPhase, PBXNativeTarget.packageProductDependencies, PBXProject.packageReferences.
Add XCRemoteSwiftPackageReference section with: repositoryURL = "https://github.com/luciqai/luciq-ios-sdk" requirement = { kind = exactVersion; version = <FETCHED_VERSION>; }
Add XCSwiftPackageProductDependency for productName = Luciq
Also update Package.swift:
ID generation notes:
Use unique 24-character hexadecimal IDs consistent with project file
Then run:
{% endstep %}
{% step %}
If integration_method == carthage
Add to Cartfile:
Then run:
{% endstep %}
{% step %}
If integration_method == manual (XCFramework)
Download: https://github.com/luciqai/luciq-ios-sdk/releases/latest/download/Luciq-XCFramework.zip
Unzip to reveal Luciq.xcframework
Drag into Xcode project → Frameworks, Libraries, and Embedded Content
Select "Embed & Sign" {% endstep %} {% endstepper %}
Step 3 — Initialize the SDK [MANDATORY - iOS]
ALWAYS use
import LuciqSDK(NOTimport Luciq) SDK initialization MUST be the FIRST line in init()/didFinishLaunchingWithOptions. UseexactSPM version requirement when adding package.
{% stepper %} {% step %}
Where to place initialization
SwiftUI: App struct's
init()— AS THE FIRST LINEUIKit: AppDelegate's
application(_:didFinishLaunchingWithOptions:)— AS THE FIRST LINE
Examples:
SwiftUI
UIKit (AppDelegate)
{% endstep %}
{% step %}
Invocation Events Syntax
Default invocation events: [.shake, .floatingButton]
Examples:
Mapping:
none → []
single → [selected]
multiple → [event1, event2, ...] {% endstep %}
{% step %}
Step 3B — Add Info.plist Permissions
Fetch app name from Info.plist (CFBundleDisplayName or CFBundleName) or project.pbxproj (PRODUCT_NAME) and add if not present:
Implementation:
Locate Info.plist
Add NSMicrophoneUsageDescription if missing
Add NSPhotoLibraryUsageDescription if missing
Inform user of added permissions
Mask Sensitive Data (AFTER Luciq.start()) — SwiftUI example:
Recursive helper (as provided earlier) must handle dictionaries and arrays.
Key points:
Masking MUST be configured AFTER Luciq.start()
Use Sets for performance
Handle nested JSON recursively
Optional Step 2 — Mask Repro Step Screenshots (iOS)
Default: .maskNothing
API examples:
Available mask types:
.maskNothing.textInputs.labels.media
SwiftUI auto-masking:
Changing masked types from
.maskNothingautomatically masks SwiftUI viewsTo disable auto-masking:
Luciq.autoMaskSwiftUIViews = false
Present a numbered menu for the user to select which elements to mask (1–7 as in original workflow). WAIT for selection.
Optional Step 3 — Configure Repro Steps Mode (iOS)
Present a multiple-selection menu:
Bug Reporting
Crash Reporting
Session Replay
All products
None
Keep defaults
Apply mapping:
Selected → .enable (with screenshots)
Not selected → .enabledWithNoScreenshots (without screenshots)
WAIT for user input and apply platform-specific calls accordingly.
Optional Step 4 — Add User Identification (iOS)
Present numbered choices:
Using email
Using user ID
Using both email and ID
Skip
If user skips, end flow. Otherwise, identify login/logout flows and instrument:
Identify after successful authentication and before navigation:
Examples:
Email only:
Luciq.identifyUser(withID: nil, email: user.email, name: user.name)ID only:
Luciq.identifyUser(withID: user.id, email: nil, name: user.name)Both:
Luciq.identifyUser(withID: user.id, email: user.email, name: user.name)
Logout call (call BEFORE clearing session/data):
WAIT for user to confirm placements and apply code.
Optional Step 5 — Upload dSYM Files (iOS)
This step is configured automatically based on Fastlane detection (Step 1D). Present options:
Automatic (recommended) — Fastlane plugin or Run Script Build Phase
Manual — upload through dashboard
Skip
If Fastlane detected (fastlane_detected == true) — Fastlane plugin approach:
In Fastfile (archive lane):
Plugin params:
api_token (required)
dsym_array_paths (required for local archives)
eu (optional)
end_point (optional)
If Fastlane not detected — add Run Script Build Phase (agent MUST modify project.pbxproj):
Add a PBXShellScriptBuildPhase named "Upload dSYM to Luciq" with shellScript:
Notes:
Use
exit 0when script not found to avoid build failuresReplace
<APP_TOKEN>with token from Step 1A
Agent must add the build phase to PBXNativeTarget.buildPhases as LAST item.
Step 4 — Verification & Testing (Wrap up & validate) [USER-INITIATED ONLY]
This step must only run when the user explicitly selects "Wrap up & validate".
Display summary and options:
WAIT for selection. Do NOT proceed to build verification unless user selects option 2.
Build Verification (Only when requested)
Run iOS build verification command:
Expected: ** BUILD SUCCEEDED **
Common iOS build errors and fixes:
"no such module 'Luciq'" → used
import Luciqinstead ofimport LuciqSDK"version not found" → invalid SPM version — verify releases/latest
"Missing package product 'Luciq'" → add "Luciq" product to target
Runtime Testing (Manual)
Build and run the app on simulator/device
Trigger Luciq using configured invocation method:
Shake: Hardware → Shake (Cmd+Ctrl+Z in simulator)
Screenshot: take screenshot
Floating Button: tap overlay
Verify Luciq UI appears
Submit test bug report
Check Luciq dashboard: https://dashboard.luciq.ai
Final Summary (after successful validation)
Display:
Error Handling & Troubleshooting (iOS highlights)
SDK Not Initializing
Verify token is correct
Check initialization code placement (App entry point)
Ensure
import LuciqSDKis used
Network Logging Not Working
Ensure masking code is after
Luciq.start()Confirm NetworkLogger is available via
import LuciqSDK
User Identification Not Showing
Verify identifyUser called after successful login and not with all nil params
Reports Not Appearing in Dashboard
Check internet, app token, and dashboard filters
iOS-specific errors:
"Command SwiftCompile failed" — check imports and syntax (
import LuciqSDK)"Fastlane dSYMs file is not found!" — ensure
dsym_array_pathsparameter when using local archives
iOS Quick Reference
Last updated