Help centerMobile

Mobile SDKs

iOS, Android, React Native, and Flutter — set the key and consent.

The key shown by the wizard (ck_ios_… or ck_android_…) identifies the app. The production API is https://api.cockpiit.com.

The first event shows up only after consent is granted. While it is pending, the SDK keeps events in memory, with no disk and no network. When it is denied, they are dropped.

iOS

Swift
import Cockpiit

Cockpiit.configure(apiKey: "ck_ios_xxx", options: .init(consent: .pending, debug: true))
Cockpiit.setConsent(.granted)
Cockpiit.screen("Home")

Android

Kotlin
Cockpiit.configure(context, "ck_android_xxx", CockpiitOptions(consent = Consent.PENDING))
Cockpiit.setConsent(Consent.GRANTED)

React Native

Terminal
npm install @cockpiit/react-native
TypeScript
import Cockpiit from '@cockpiit/react-native'
Cockpiit.configure(apiKey, { consent: 'pending', debug: true })
Cockpiit.setConsent('granted')

A native rebuild is required after installing the package.

Flutter

YAML
dependencies:
  cockpiit_flutter: ^0.1.0
Dart
await Cockpiit.configure(apiKey, CockpiitOptions(consent: Consent.pending, debug: true));
await Cockpiit.setConsent(Consent.granted);

Check

Grant consent, send a screen, then flush the queue (flush on the SDK that has it). The wizard screen waiting for the first event turns green. Then open Users and Acquisition.