📄️ Overview
This document is for the mobile engineer integrating the B2Metric React Native SDK into an app, and it assumes you're already comfortable with React Native, JavaScript or TypeScript, and the usual iOS and Android build tooling. It doesn't assume any prior analytics background; anything specific to B2Metric is explained as it comes up.
📄️ Installation
iOS additionally requires linking the native module via CocoaPods:
📄️ Quick Start
Call init() once at app startup before using any other SDK method. Subsequent calls are ignored.
📄️ Configuration
| Option | Type | Required | Default | Range | Description |
📄️ Event Tracking
Item Properties
📄️ User Identification
setUser sends a useridentify event and merges attributes into userproperties on every subsequent event. userId is required; any additional custom attribute is also accepted.
📄️ Push Notifications
Supported providers: 'fcm' (Firebase), 'hms' (Huawei), 'apns' (Apple).
📄️ Lifecycle Management
Manual Flush
📄️ Automatic Behavior
| Behavior | Description |
📄️ API Reference
| Method | Description |
📄️ Troubleshooting
| Symptom | Resolution |
📄️ Versioning and Upgrades
The SDK follows semantic versioning (MAJOR.MINOR.PATCH). The SDK is currently at version 2.0.0, which made appIdentifier required and added setUser() for user identification, aligning behaviour with the iOS, Android, and Flutter SDKs.
📄️ Support and Contact
- Website — b2metric.com