Troubleshooting
Common issues and debugging tips for the Adopture React Native SDK.
No Events Appearing
-
Check your app key — Ensure it matches the key from your Adopture dashboard. Format:
ak_followed by 24 alphanumeric characters. -
Enable debug mode — Add
debug: trueto see all SDK activity in the console:
<AdoptureProvider appKey="ak_..." options={{ debug: true }}>-
Check the console — Look for log lines prefixed with
[Adopture]. You should see initialization, event tracking, and batch sending logs. -
Verify peer dependencies — Ensure
@react-native-async-storage/async-storageandreact-native-get-random-valuesare installed. Missing peer deps cause silent failures. -
Check the API endpoint — If using a custom endpoint, ensure it's reachable from the device/simulator.
Events Are Delayed
This is expected behavior. Events are batched and sent every 30 seconds (or when 20 events are queued). In debug mode, events are sent immediately.
To send events right away in production:
await Adopture.flush();Rate Limit Errors
If you see 429 responses in the console, you're sending events too quickly. The SDK handles this automatically — it logs the Retry-After header and continues on the next flush cycle. No events are lost.
To reduce request frequency, increase the flush interval:
<AdoptureProvider
appKey="ak_..."
options={{ flushIntervalMs: 60000, flushAt: 50 }}
>SDK Not Initialized
If you see errors about the SDK not being initialized:
- Ensure
AdoptureProviderwraps your app at the root level - If using the imperative API,
await Adopture.init()before calling any other methods - Check that initialization isn't wrapped in conditional logic
Missing Native Modules
iOS: Run cd ios && pod install after installing dependencies.
Android: Native modules are auto-linked. If you have issues, run npx react-native clean and rebuild.
Expo: Use npx expo install instead of npm install to ensure compatible versions. Run npx expo prebuild if you encounter native module errors.
Opt-Out and Disable
To disable tracking (e.g. for a privacy toggle):
// Disable — stops tracking, clears the event queue
await Adopture.disable();
// Re-enable
Adopture.enable();Check SDK State
Inspect the SDK state at any time:
Adopture.isInitialized // true if init() completed
Adopture.isEnabled // true if tracking is active
Adopture.queueLength // number of queued events
Adopture.sessionId // current session UUID