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
import Cockpiit
Cockpiit.configure(apiKey: "ck_ios_xxx", options: .init(consent: .pending, debug: true))
Cockpiit.setConsent(.granted)
Cockpiit.screen("Home")Android
Cockpiit.configure(context, "ck_android_xxx", CockpiitOptions(consent = Consent.PENDING))
Cockpiit.setConsent(Consent.GRANTED)React Native
npm install @cockpiit/react-nativeimport 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
dependencies:
cockpiit_flutter: ^0.1.0await 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.