Skip to main content

Troubleshooting

If something is not behaving as expected, the first step is almost always to enable debug logging and look at the console output. The SDK is intentionally verbose at logLevel: 'debug' — every state transition, every batch attempt, and every validation decision is logged.

await B2Metric.init({
apiKey: 'YOUR_API_KEY',
appIdentifier: 'your_app_identifier',
logLevel: 'debug',
})

10.1 Common Situations

Events do not appear in the dashboard

Check the following in order:

  • Is logLevel set to debug? Look for a line that says 'B2Metric SDK initialized successfully'. If you do not see it, init was either not called or threw an error.
  • Are events being queued? Debug logs include a line each time an event is enqueued. If you see those but no delivery attempts, the device may be offline.
  • Is the API key correct, and does it correspond to the same B2Metric project you are looking at in the dashboard? A typo silently produces a project mismatch — events are accepted by the server but appear in a different project.
  • Is the appIdentifier the one you expect? If you mistyped it during integration, events appear under the wrong app rather than failing.

This error is thrown when a tracking method (logEvent, registerPushToken, trackPushOpened, flush) is called before init has resolved. Make sure your init call is awaited and that your tracking code does not run during module-load time before the root effect has fired.

iOS build fails with 'missing pod'

Run cd ios && pod install again, and confirm that the iOS deployment target in your Podfile is set to 13.0 or higher. If the build still fails, also delete the ios/Pods directory and the Podfile.lock, then re-run pod install — a stale lockfile can pin transitive dependencies to versions incompatible with the SDK's native module.

Android build fails with 'minSdkVersion 24' message

Raise your minSdkVersion in android/build.gradle to at least 24. This is a hard floor for the SDK's native module and cannot be worked around.

Configuration value seems to be ignored

Values outside the documented range are clamped automatically; for example a batchSize of 500 will silently become 100. Set logLevel: 'warning' or higher to surface a warning when this happens.

Versioning and Upgrades

The SDK follows semantic versioning (MAJOR.MINOR.PATCH):

  • Major — backwards-incompatible changes to the public API. Upgrading may require code changes in your app. Migration notes are published in the package changelog.
  • Minor — backwards-compatible new features. Safe to upgrade without code changes.
  • Patch — bug fixes only. Always safe to upgrade.

The SDK is currently at version 0.2.0. While it is still in the 0.x range, minor version bumps may introduce small breaking changes — please review the changelog before upgrading between 0.x releases.

Pinning the Version

For production apps we recommend pinning to an exact version or to a tilde range so that minor changes are not picked up automatically by npm install or yarn:

{
"dependencies": {
"@b2metric/react-native-sdk": "0.2.0"
}
}

After upgrading, re-run cd ios && pod install so that the iOS native module is rebuilt against the new version.

Support and Contact

If you run into issues during integration that aren't covered by the Troubleshooting section, or if you have feature requests or feedback about the SDK, the B2Metric team is available through the channels below. When reporting a bug, please include the SDK version, the React Native version, the target platform (iOS or Android), and any relevant debug log output — these details speed up diagnosis considerably.