diff --git a/README.md b/README.md
index 26426fd..71224e3 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,8 @@
-
-
+
-
-
+
# Bridgefy React Native SDK
@@ -12,25 +10,30 @@


+
The **Bridgefy Software Development Kit (SDK)** is a state‑of‑the‑art plug‑and‑play solution that enables offline communication in your mobile apps by using Bluetooth mesh networks.
Integrate the Bridgefy SDK into your Android and iOS app to reach users who don't always have a reliable Internet connection and keep engagement high even in challenging environments.
**Website:** [https://bridgefy.me/sdk](https://bridgefy.me/sdk)
+
**Email:** [contact@bridgefy.me](mailto:contact@bridgefy.me)
+
**Twitter:** [https://twitter.com/bridgefy](https://twitter.com/bridgefy)
+
**Facebook:** [https://www.facebook.com/bridgefy](https://www.facebook.com/bridgefy)
----
+***
## Operation mode
Bridgefy automatically manages device discovery and connections to create a **mesh network**, whose size depends on the number of nearby devices and environmental conditions.
This mesh allows messages to hop across multiple devices, letting nodes in the same cluster or in different clusters exchange data without Internet access.
+
+
+
-
-
----
+***
## Platform permissions
@@ -39,128 +42,387 @@ Before using the SDK in a React Native app, configure the required permissions a
- [iOS Permissions](https://github.com/bridgefy/sdk-ios#permissions)
- [Android Permissions](https://github.com/bridgefy/sdk-android#android-permissions)
----
+***
## Installation
-Install the SDK via npm or Yarn.
+1. Add the Bridgefy React Native package to your project:
```bash
+
npm i bridgefy-react-native
# or
yarn add bridgefy-react-native
+
```
----
+2. Make sure you are using:
+
+- Android Gradle Plugin with D8/desugaring enabled.
+- Xcode 14+ for iOS builds.
+
+***
## Usage
+
+
+### Migration Guide: Legacy → TurboModule SDK
+
+ API changes, new features, and gotchas.
+
+### Import & Instantiation
+❌ Old
+```typescript
+import { Bridgefy } from 'bridgefy-react-native';
+const bridgefy = new Bridgefy();
+```
+
+✅ New
+
+```typescript
+import Bridgefy from 'bridgefy-react-native'; // Singleton instance
+```
+
+**New:** Use `Bridgefy` class (wraps EventEmitter + convenience methods).
+
+### Initialization
+
+❌ Old
+```typescript
+import { Bridgefy } from 'bridgefy-react-native';
+const bridgefy = new Bridgefy();
+await bridgefy.initialize(apiKey, verboseLogging);
+```
+✅ New (Added operationMode)
+
+```typescript
+import Bridgefy, { BridgefyOperationMode } from 'bridgefy-react-native';
+
+await Bridgefy.initialize(apiKey, verboseLogging, BridgefyOperationMode.HYBRID);
+```
+**New:** `operationMode?: BridgefyOperationMode` (FOREGROUND/BACKGROUND/HYBRID).
+
+### Propagation Profiles
+
+❌ Old (Missing realtime)
+
+```typescript
+export enum BridgefyPropagationProfile {
+ standard = 'standard',
+ highDensityNetwork = 'highDensityNetwork', // Note: different name
+ sparseNetwork = 'sparseNetwork',
+ longReach = 'longReach',
+ shortReach = 'shortReach',
+}
+```
+
+✅ New (Added Realtime, renamed)
+
+```typescript
+import Bridgefy, { BridgefyPropagationProfile } from 'bridgefy-react-native';
+
+await Bridgefy.start(userId, BridgefyPropagationProfile.REALTIME); // New!
+
+```
+**Mapping:**
+
+| Old | New |
+| ------------------ | -------------------- |
+| highDensityNetwork | HIGH_DENSITY_NETWORK |
+| Others match | + REALTIME |
+
+### Error Handling
+
+❌ Old (String enums)
+
+```typescript
+export enum BridgefyErrorType {
+ simulatorIsNotSupported = 'simulatorIsNotSupported',
+ // Many iOS/Android-specific
+}
+```
+
+✅ New (Unified codes)
+
+```typescript
+import Bridgefy, { BridgefyErrorCode, type BridgefyError } from 'bridgefy-react-native';
+
+onFailToStart((error: BridgefyError) => {
+ if (error.code === BridgefyErrorCode.SERVICE_NOT_STARTED) { /* handle */ }
+});
+
+```
+**New:** `BridgefyError = { code: BridgefyErrorCode, message: string, ... }` – consolidated codes.
+
+### Events (Biggest Change!)
+
+❌ Old (Manual EventEmitter)
+
+```typescript
+import { NativeEventEmitter } from 'react-native';
+const emitter = new NativeEventEmitter(BridgefyReactNative);
+
+emitter.addListener(BridgefyEvents.bridgefyDidStart, handler);
+```
+
+✅ New (Typed helpers + full coverage)
+```typescript
+import Bridgefy from 'bridgefy-react-native';
+// Convenience methods (recommended)
+Bridgefy.onStart((event) => console.log(event.userId));
+Bridgefy.onReceiveData((event) => console.log(event.data));
+
+// Full list (17+ events vs old 9)
+Bridgefy.onConnectedPeers(({ peers }) => updatePeers(peers));
+Bridgefy.onSendDataProgress(({ position, of }) => updateProgress(position / of));
+```
+
+**New events:** `DID_UPDATE_CONNECTED_PEERS`, `SEND_DATA_PROGRESS`, operation mode.
+
+**Cleanup:**
+```typescript
+sub.remove(); // All helpers return { remove }
+Bridgefy.removeAllListeners(); // Clears everything
+```
+
+### Send Messages
+❌ Old (Always required uuid)
+```typescript
+await BridgefyReactNative.send(data, { type: 'broadcast', uuid: '...' });
+
+```
+✅ New (Convenience + optional uuid)
+```typescript
+import Bridgefy from 'bridgefy-react-native';
+
+// Broadcast (auto-generates uuid)
+await Bridgefy.sendBroadcast('Hello all');
+
+// P2P/Mesh (shorthand)
+await Bridgefy.sendP2P('Hi!', 'recipient-id');
+await Bridgefy.sendMesh('Through mesh', 'recipient-id');
+
+// Raw (uuid optional for broadcast)
+await Bridgefy.send(data, { type: BridgefyTransmissionModeType.BROADCAST });
+```
+**Returns:** `Promise` (messageId)
+
+### New Methods (Must‑use)
+```typescript
+import Bridgefy from 'bridgefy-react-native';
+
+// Operation mode (BACKGROUND/HYBRID!)
+await Bridgefy.setOperationMode({ mode: BridgefyOperationMode.HYBRID });
+const status = await Bridgefy.getOperationStatus(); // { shouldRunInService, debugInfo }
+
+// Background/foreground switches
+await Bridgefy.switchToBackground();
+
+// Connected peers array (vs old object?)
+const peers = await Bridgefy.connectedPeers(); // string[]
+
+```
+
+### Breaking Changes Summary
+
+| Area | Old | New |
+| ------- | ------------------ | --------------------------- |
+| Events | 9 manual | 17+ typed helpers |
+| Profile | 5 (no realtime) | 6 (+REALTIME) |
+| Error | String enums | BridgefyError objects |
+| Send | Manual uuid always | Convenience + optional uuid |
+| Init | 2 params | 3 params (+mode) |
+| Peers | Object? | string[] |
+| License | Date object | Timestamp number |
+
+
+
+***
+
### Initialization
Use `initialize` to configure the Bridgefy SDK with your API key and base options.
```typescript
-import { Bridgefy, BridgefyPropagationProfile } from 'bridgefy-react-native';
-const bridgefy = new Bridgefy();
+import Bridgefy, {
+ BridgefyOperationMode,
+} from 'bridgefy-react-native';
export default function App() {
React.useEffect(() => {
- bridgefy
- .initialize({
- apiKey: 'your-api-key-here', // UUID - Your Bridgefy license key.
- verboseLogging: false, // Enables or disables verbose logs.
- operationMode: 'hybrid', // foreground | background | hybrid
- })
- .catch((error) => {
+ // Example: initialize & start
+ Bridgefy.initialize(
+ 'YOUR_API_KEY', // UUID - Your Bridgefy license key.
+ true, // Enables or disables verbose logs.
+ BridgefyOperationMode.FOREGROUND // foreground | background | hybrid
+ ).catch((error) => {
console.error(error);
});
+
}, []);
}
```
+- **apiKey:** Provided by Bridgefy developer site.
+- **verboseLogging:** `true` for debugging.
+- **operationMode:** `FOREGROUND`, `BACKGROUND`, or `HYBRID`.
### Starting and stopping the SDK
Once initialized, you can start or stop the SDK as needed.
```typescript
+import Bridgefy, {
+ BridgefyPropagationProfile,
+} from 'bridgefy-react-native';
/**
* Start Bridgefy SDK operations
*/
-bridgefy.start(
- userId, // Optional UUID - Custom user identifier in the network.
- propagationProfile, // Optional BridgefyPropagationProfile - Message propagation profile.
+Bridgefy.start(
+ 'your-user-id', // Optional UUID - Custom user identifier in the network.
+ BridgefyPropagationProfile.REALTIME // Optional BridgefyPropagationProfile - Message propagation profile.
);
+```
+- **userId:** Optional session uuid.
+- **propagationProfile:** how messages travel through the mesh network. Choose the best fit for your use case.
+```typescript
/**
* Stop Bridgefy SDK operations
*/
-bridgefy.stop();
+Bridgefy.stop();
```
----
+***
## Sending data
-Use `send` to transmit serialized string data using a transmission mode.
+Under the hood, these call `send(data, transmissionMode)` with the proper `BridgefyTransmissionModeType`.
```typescript
+import Bridgefy from 'bridgefy-react-native';
+
async function sendData() {
- const userId = await bridgefy.currentUserId();
- const lastMessageId = await bridgefy.send(
- 'data', // String-encoded data to send.
- {
- type: BridgefyTransmissionModeType.broadcast,
- uuid: userId,
- },
- );
+
+ // Broadcast
+ const lastBroadcastMessageId = await Bridgefy.sendBroadcast(JSON.stringify({ text: 'Hello everyone' }));
+
+ // P2P
+ const lastP2PMessageId = await Bridgefy.sendP2P(JSON.stringify({ text: 'Hello peer' }), 'recipient-user-id');
+
+ // Mesh
+ const lastMeshMessageId = await Bridgefy.sendMesh(JSON.stringify({ text: 'Through mesh' }), 'recipient-user-id');
+
}
```
The method returns a message UUID you can use for tracking or acknowledgement flows.
----
+***
## Handling SDK events
-Bridgefy emits lifecycle and messaging events through React Native's `NativeEventEmitter`.
-Subscribe to events to track startup, incoming messages, errors, and other state changes.
-
-```typescript
-React.useEffect(() => {
- const subscriptions: EmitterSubscription[] = [];
- const eventEmitter = new NativeEventEmitter(
- NativeModules.BridgefyReactNative
- );
-
- // Fired when the Bridgefy SDK has started successfully.
- subscriptions.push(
- eventEmitter.addListener(BridgefyEvents.bridgefyDidStart, (event) => {
- console.log('Bridgefy started', event);
- })
- );
-
- // Fired when this device receives data from another Bridgefy device.
- subscriptions.push(
- eventEmitter.addListener(
- BridgefyEvents.bridgefyDidReceiveData,
- (event) => {
- console.log('Bridgefy received data', event);
- }
- )
- );
-
- return () => {
- for (const sub of subscriptions) {
- sub.remove();
- }
- };
-}, []);
+Bridgefy provides a comprehensive event system via React Native's `NativeEventEmitter`,
+with typed helper methods on the `Bridgefy` class for easy listening.
+All events are defined in the `BridgefyEvents` enum and emit from the native Module.
+
+### Event Listening Basics
+Use `addEventListener(eventName, listener)` for any event, or the typed helpers like `onStart(listener)`.
+Each returns `{ remove: () => void }` for cleanup. Always call `remove()` or `removeAllListeners()` to prevent leaks, especially in components.
+
+
+```typescript
+
+import Bridgefy,
+ { BridgefyEvents }
+ from 'bridgefy-react-native';
+
+// Generic listener
+const sub = Bridgefy.addEventListener(BridgefyEvents.BRIDGEFY_DID_START, (event) => {
+ console.log(event);
+});
+sub.remove(); // Clean up
+
+// Helper (preferred)
+const subHelper = Bridgefy.onStart((event) => console.log(event.userId));
+subHelper.remove();
+
```
+### Lifecycle Events
+
+These track SDK start/stop/destroy operations.
+
+- `onStart(listener: (event: BridgefyStartEvent) => void)` → `BRIDGEFY_DID_START`
+
+ - Fires when SDK starts successfully.
+ - Payload: `{ userId: string }` (your assigned UUID).
+
+- `onStop(listener: () => void)` → `BRIDGEFY_DID_STOP`
+ - SDK stopped cleanly.
+
+- `onFailToStart(listener: (error: BridgefyError) => void)` → `BRIDGEFY_DID_FAIL_TO_START`
+ - Start failed (e.g., permissions, Bluetooth off).
+ - Payload: `BridgefyError` with `code` like `BLUETOOTH_DISABLED`.
+
+- `onFailToStop(listener: (error: BridgefyError) => void)` → `BRIDGEFY_DID_FAIL_TO_STOP`
+ - Stop operation failed.
+
+- `BRIDGEFY_DID_DESTROY_SESSION` / `BRIDGEFY_DID_FAIL_TO_DESTROY_SESSION`
+ - Session destroyed or failed (use generic addEventListener).
-For a complete list of available events, see the `BridgefyEvents` enum in the SDK API reference.
+### Connection Events
+Monitor peer connections and network changes.
----
+- `onConnect(listener: (event: BridgefyConnectEvent) => void)` → `BRIDGEFY_DID_CONNECT`
+ - New peer connected.
+ - Payload: `{ userId: string }`.
+
+- `onConnectedPeers(listener: (event: BridgefyUpdatedConnectedEvent) => void)` → `BRIDGEFY_DID_UPDATE_CONNECTED_PEERS`
+ - Peers list updated (add/remove).
+ - Payload: `{ peers: string[] }` (array of user UUIDs).
+
+- `onDisconnect(listener: (event: BridgefyDisconnectEvent) => void)` → `BRIDGEFY_DID_DISCONNECT`
+ - Peer disconnected.
+ - Payload: `{ userId: string }`.
+
+### Secure Connection Events
+For encrypted P2P/mesh communication.
+- `onEstablishSecureConnection(listener: (event: BridgefySecureConnectionEvent) => void)` → `BRIDGEFY_DID_ESTABLISH_SECURE_CONNECTION`
+ - Secure link ready.
+ - Payload: `{ userId: string }`.
+
+- `onFailToEstablishSecureConnection(listener: (error: BridgefyError & { userId: string }) => void)` → `BRIDGEFY_DID_FAIL_TO_ESTABLISH_SECURE_CONNECTION`
+ - Secure setup failed (e.g., timeout).
+ - Payload: BridgefyError + { userId: string }.
+
+### Message Events
+Track send/receive progress and failures.
+
+- `onSendMessage(listener: (event: BridgefySendMessageEvent) => void)` → `BRIDGEFY_DID_SEND_MESSAGE`
+ - Message sent successfully.
+ - Payload: '{ messageId: string }` (UUID).
+
+- `onSendDataProgress(listener: (event: BridgefyDidSendDataProgress) => void)` → `BRIDGEFY_DID_SEND_DATA_PROGRESS`
+ - Transfer progress (useful for large payloads).
+ - Payload: `{ messageId: string, position: number, of: number }`.
+
+- `onFailSendingMessage(listener: (error: BridgefyError & { messageId: string }) => void)` → `BRIDGEFY_DID_FAIL_SENDING_MESSAGE`
+ - Send failed (e.g., no path).
+ - Payload: `BridgefyError` + `{ messageId: string }`.
+
+- `onReceiveData(listener: (event: BridgefyReceiveDataEvent) => void)` → `BRIDGEFY_DID_RECEIVE_DATA`
+ - Data received.
+ - Payload: `{ data: string, messageId: string, transmissionMode: BridgefyTransmissionMode }`.
+
+- `BRIDGEFY_MESSAGE_RECEIVED`
+ - Legacy message event (use generic listener).
+
+### License events (removed)
+
+License events have been removed from the latest Bridgefy React Native SDK and are no longer emitted at runtime. If you previously used `onUpdateLicense` or `onFailToUpdateLicense`, you can safely delete those listeners; license validation now runs internally.
+
+***
## Additional functionality
@@ -170,28 +432,97 @@ The `Bridgefy` class exposes several helper methods to manage sessions, connecti
- `establishSecureConnection(userId: string): Promise`: Establishes an end-to-end encrypted connection with the specified peer.
- `currentUserId(): Promise`: Returns the current device's user identifier.
- `connectedPeers(): Promise`: Returns the list of currently connected peers.
-- `licenseExpirationDate(): Promise`: Returns the configured license expiration date.
-- `updateLicense(): Promise`: Refreshes the SDK license (for renewed or upgraded plans).
+- `licenseExpirationDate(): Promise`: Returns the configured license expiration timestamp (milliseconds since epoch).
+- `updateLicense(): Promise`: Deprecated: License updates are handled automatically; this method is preserved only for backwards compatibility and will be removed in a future release.
- `isInitialized(): Promise`: Indicates whether the SDK has been initialized.
- `isStarted(): Promise`: Indicates whether the SDK is currently running.
### Operation mode control
-These methods let you inspect and change how Bridgefy runs at runtime.
+Bridgefy's runs in relation to your app's lifecycle,
+balancing battery efficiency, reliability, and background connectivity.
+They are defined in the `BridgefyOperationMode` enum and set during `initialize` or runtime.
+
+**FOREGROUND Mode**
+
+SDK runs **only when your app is in the foreground**.
+- **Key traits:**
+ - No background service needed.
+ - Stops BLE scanning/mesh when app backgrounds (e.g., user switches apps).
+ - Lowest battery impact.
+
+- **Best for:** Testing, development, or foreground-only apps like games.
+- **Trade-offs:** No connectivity when backgrounded; simple setup (no Android manifest changes).
+
+**BACKGROUND Mode**
+
+SDK runs **continuously in a foreground service**, even when app is backgrounded or killed.
+- **Key traits:**
+ - Persistent mesh networking.
+ - Shows persistent notification (Android requirement for foreground services).
+ - Higher battery drain due to constant BLE.
-- `setOperationMode(config: BridgefyOperationModeConfig): Promise`
-- `getOperationMode(): Promise`
-- `switchToBackground(): Promise`
-- `switchToForeground(): Promise`
-- `getOperationStatus(): Promise`
+- **Best for:** Always-on messaging apps needing 24/7 mesh.
+- **Trade-offs:** Requires Android service declaration + FOREGROUND_SERVICE permission; visible notification; more battery use.
-Always handle promises and error cases to keep your networking layer **robust** and responsive.
+**HYBRID Mode**
----
+**Adaptive mode** that switches automatically: foreground when app active, background service when backgrounded.
+
+- **Key traits:**
+ - Starts in foreground (efficient when visible).
+ - Auto-switches to service on background (maintains connectivity).
+ - Uses switchToBackground() / switchToForeground() under the hood.
+
+- **Best for:** Most production apps – balances UX, battery, and reliability.
+- **Trade-offs:** Needs both foreground and service setup; seamless transitions.
+
+### API Usage
+Set mode at init or runtime (after `initialize`).
+
+```typescript
+
+import Bridgefy, {
+ BridgefyOperationMode,
+} from 'bridgefy-react-native';
+
+import { BridgefyOperationMode } from 'bridgefy-react-native';
+
+// At initialization (recommended)
+await Bridgefy.initialize('YOUR_KEY', false, BridgefyOperationMode.HYBRID);
+
+// Runtime change
+await Bridgefy.setOperationMode({ mode: BridgefyOperationMode.BACKGROUND });
+
+// Check current
+const mode = await Bridgefy.getOperationMode(); // Returns 'foreground' | 'background' | 'hybrid'
+
+// Full status
+const status = await Bridgefy.getOperationStatus();
+// Returns: { operationMode, isInitialized, isStarted, shouldRunInService, debugInfo }
+
+// Manual switches (for HYBRID)
+await Bridgefy.switchToBackground();
+await Bridgefy.switchToForeground();
+
+```
+Type: `BridgefyOperationModeConfig = { mode: BridgefyOperationMode };` `BridgefyOperationModeStatus` includes service flags.
+
+### Setup Notes
+
+**iOS Security imposes several limitations on applications participating in communication sessions when the app is not on the active screen.**
+
+- **Android:** BACKGROUND/HYBRID need ` ` and permissions.
+- **Recommendation:** Start with HYBRID for production; use getOperationStatus() to debug service issues.
+
+***
## Bridgefy propagation profiles
-The `BridgefyPropagationProfile` enum defines presets for how messages propagate through the mesh, so you can tune behavior to your use case.
+The `BridgefyPropagationProfile` optimize mesh networking for different environments by tuning **hops, TTL, sharing time, propagation limits, and tracking**.
+Select during `start()` to match your use case.
+
+### When to Use Each
- `STANDARD`: Balanced default profile for general messaging.
- `HIGH_DENSITY_NETWORK`: Optimized for crowded environments such as concerts or stadiums.
@@ -200,30 +531,108 @@ The `BridgefyPropagationProfile` enum defines presets for how messages propagate
- `SHORT_REACH`: Focuses on nearby devices only.
- `REALTIME`: Prioritizes ultra-low latency for time-sensitive notifications.
----
+***
+
+## Common Errors
+
+### Android
+
+ Gradle & D8 / Desugar Requirements
+
+Bridgefy uses modern Java APIs and requires *D8 and core library desugaring* to be enabled.
+
+In your root `android/build.gradle` (or `settings.gradle` + new AGP configuration), ensure:
+
+- Android Gradle Plugin version supports desugaring (AGP 7+ recommended).
+- Java 8+ compatibility and core library desugaring are enabled in app module.
+
+In `android/app/build.gradle`:
+```groovy
+android {
+ compileSdkVersion 34
+
+ defaultConfig {
+ minSdkVersion 23
+ targetSdkVersion 34
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ coreLibraryDesugaringEnabled true // Enable desugaring
+ }
+}
+
+dependencies {
+ // Required for desugaring
+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
+}
+
+```
-## Background/foreground operation modes guide
+This avoids “Default interface methods” and time API issues at runtime.
+
+
+
+
+ Android Service (Background / Hybrid Modes)
+
+When using **BACKGROUND** or **HYBRID** `BridgefyOperationMode`, Bridgefy should run in a foreground service so it keeps the mesh active while your app is in the background.
+
+1. Declare the service in `AndroidManifest.xml`:
+```xml
+
+
+```
+2. Add required permissions:
+
+```xml
+
+
+
+
+
+
+
+
+```
+Missing runtime permissions for BLE scanning.
+
+**Fix**(Android 12+):
+```xml
+
+
+
+
+
+```
+
+3. At runtime, request the necessary Bluetooth and location permissions before starting the SDK.
+
+
+
+ FOREGROUND_SERVICE permission crash
+
+**Cause:** Missing permission for Android 14+.
+
+**Fix:** Add to AndroidManifest.xml:
+```xml
+
+```
-Bridgefy supports three main operation modes with different trade-offs in availability and battery usage.
+**Bluetooth denied in background**
-1. **FOREGROUND mode**
- - SDK runs only while the app is in the foreground.
- - No persistent background service.
- - Lower battery usage and simpler integration.
- - Good for development, demos, or foreground-only use cases.
+**Cause:** Android restricts BLE in background without foreground service.
-2. **BACKGROUND mode** (Android)
- - SDK runs continuously in a foreground service, even when the app is backgrounded.
- - Enables always-on mesh networking and better reachability.
- - Higher battery consumption; best for critical connectivity scenarios.
+**Fix:** Use BACKGROUND/HYBRID mode + service setup.
-3. **HYBRID mode (recommended)**
- - Runs in the foreground while the app is active.
- - Automatically switches to background mode when the app is backgrounded.
- - Automatically resumes foreground mode when the app becomes active again.
- - Smart balance between connectivity and battery for the best user experience.
+
----
+***
## Multi-platform support
@@ -232,7 +641,7 @@ Bridgefy SDKs interoperate across platforms so iOS and Android devices can commu
- [Bridgefy iOS](https://github.com/bridgefy/sdk-ios)
- [Bridgefy Android](https://github.com/bridgefy/sdk-android)
----
+***
## Contact & support
@@ -241,6 +650,6 @@ For commercial inquiries, technical questions, or integration help, reach out us
- Email: [contact@bridgefy.me](mailto:contact@bridgefy.me)
- Website: [https://bridgefy.me/sdk](https://bridgefy.me/sdk)
----
+***
© 2026 Bridgefy Inc. All rights reserved.
diff --git a/android/build.gradle b/android/build.gradle
index b4f3e6e..ab31b54 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -6,8 +6,7 @@ buildscript {
rootProject.allprojects {
repositories {
maven {
- url "http://34.82.5.94:8081/artifactory/libs-release-local"
- allowInsecureProtocol = true
+ url "https://maven.bridgefy.me/artifactory/libs-release-local"
}
}
}
diff --git a/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt b/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt
index eb540ac..6394f76 100644
--- a/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt
+++ b/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt
@@ -29,6 +29,7 @@ import me.bridgefy.plugin.react_native.util.OperationMode
import me.bridgefy.plugin.react_native.util.Utils.bundleFromTransmissionMode
import me.bridgefy.plugin.react_native.util.Utils.mapFromTransmissionMode
import me.bridgefy.plugin.react_native.util.Utils.transmissionModeFromBundle
+import java.util.Date
import java.util.UUID
@ReactModule(name = NativeBridgefySpec.NAME)
@@ -380,9 +381,9 @@ class BridgefyReactNativeModule(
modeManager.setOperationMode(mode)
// Start service if needed
- // if (modeManager.shouldRunInService()) {
- startService()
- // }
+ if (modeManager.shouldRunInService()) {
+ startService()
+ }
val initIntent =
Intent(context, BridgefyService::class.java).apply {
@@ -630,11 +631,30 @@ class BridgefyReactNativeModule(
}
override fun licenseExpirationDate(promise: Promise) {
- promise.reject("NOT_IMPLEMENTED", "Use service binding")
+ runCatching {
+ val exp =
+ serviceManager
+ .getBridgefy()
+ ?.licenseExpirationDate()
+ ?.getOrThrow()
+ ?.time ?: 0L
+ Arguments.createMap().apply {
+ putDouble("expirationDate", exp.toDouble())
+ putBoolean("isValid", exp > System.currentTimeMillis())
+ }
+ }.fold(
+ onSuccess = { promise.resolve(it) },
+ onFailure = {
+ promise.reject("LICENSE_ERROR", it.message)
+ },
+ )
}
override fun updateLicense(promise: Promise) {
- promise.reject("NOT_IMPLEMENTED", "Not supported")
+ promise.reject(
+ "LICENSE_UPDATE_FAILED",
+ "The updateLicense method has been deprecated and will be removed in a future release."
+ )
}
override fun isInitialized(promise: Promise) {
diff --git a/android/src/main/java/me/bridgefy/plugin/react_native/util/BridgefyOperationModeManager.kt b/android/src/main/java/me/bridgefy/plugin/react_native/util/BridgefyOperationModeManager.kt
index dcd7493..8152280 100644
--- a/android/src/main/java/me/bridgefy/plugin/react_native/util/BridgefyOperationModeManager.kt
+++ b/android/src/main/java/me/bridgefy/plugin/react_native/util/BridgefyOperationModeManager.kt
@@ -97,7 +97,7 @@ class BridgefyOperationModeManager private constructor(
fun shouldRunInService(): Boolean =
when (currentOperationMode) {
OperationMode.BACKGROUND -> true
- OperationMode.HYBRID -> currentActiveMode == OperationMode.BACKGROUND
+ OperationMode.HYBRID -> currentActiveMode == OperationMode.FOREGROUND
OperationMode.FOREGROUND -> false
}
diff --git a/bridgefy-react-native.podspec b/bridgefy-react-native.podspec
index 0b7b50f..950ffb8 100644
--- a/bridgefy-react-native.podspec
+++ b/bridgefy-react-native.podspec
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
s.private_header_files = "ios/**/*.h"
- s.dependency 'BridgefySDK', '~> 1.3.2'
+ s.dependency 'BridgefySDK', '~> 1.3.3'
install_modules_dependencies(s)
end
diff --git a/example/README.md b/example/README.md
index 7e6ff1f..33b5144 100644
--- a/example/README.md
+++ b/example/README.md
@@ -1,108 +1,217 @@
-This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
+# Bridgefy React Native – Example Project
-# Getting Started
+[](https://www.npmjs.com/package/bridgefy-react-native)
->**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
+**App ID**: `me.bridgefy.android.sample` | **Bundle ID**: `me.bridgefy.android.sample`
-To create a Bridgefy API KEY, follow these general steps:
+This is a **React Native** project bootstrapped with [`@react-native-community/cli`](https://github.com/react-native-community/cli), demonstrating full **Bridgefy SDK** integration (TurboModule, background service, mesh networking).
-* **Register for a Bridgefy account:** If you haven't already, sign up for a Bridgefy account on their website (https://developer.bridgefy.me).
+## 🚀 Quick Start
-* **Log in to the developer dashboard:** After registering, log in to your Bridgefy account and access the developer dashboard. The dashboard is where you can manage your API KEY and access other developer-related resources.
+1. **Clone & Install**
+ ```bash
+ git clone
+ cd example
+ yarn install
+ cd ios && pod install && cd ..
+ ```
-* **Generate an API KEY:** Once you've created a project, you should be able to generate an API KEY specific to that project. The API KEY is a unique identifier that allows you to use Bridgefy's services.
+2. **Configure API Key** (see below)
+3. **Run** (2+ **physical devices** nearby!)
+ ```bash
+ yarn android # or yarn ios (real device)
+ ```
- **Only for this sample project**
- * Add the application id `me.bridgefy.android.example` for Android.
- * Add the bundleId `me.bridgefy.react.sample` for iOS.
+---
-* **Integrate the API KEY:** After generating the API KEY, you'll typically receive a KEY string. Integrate this KEY into your application or project to start using Bridgefy's messaging services.
+## 📱 Get Your Bridgefy API Key
- **Only for this sample project**
+1. **Register**: [Bridgefy Developer](https://developer.bridgefy.me)
+2. **Create Project** with:
+ - **Android**: `me.bridgefy.android.sample`
+ - **iOS**: `me.bridgefy.android.sample`
+3. **Copy API Key** → Replace `YOUR_API_KEY_HERE` in `src/config/environment.ts`
- Replace the text "YOUR_API_KEY_HERE" with a key generated from your account, the paths where it should be replaced are as follows:
-> example/android/app/src/main/AndroidManifest.xml
->
-> example/src/config/environment.ts
-
-* **Review the documentation:** As you integrate the API into your application, refer to the Bridgefy documentation and guides for information on how to use their API effectively. The documentation should include details on available endpoints, usage limits, and best practices.
- * Documentation: https://docs.bridgefy.me/
- * Github
- * [Android](https://github.com/bridgefy/sdk-android)
- * [iOS](https://github.com/bridgefy/sdk-ios)
-
-___
-
-## Step 1: Start the Metro Server
+**Paths to update**:
+```
+src/config/environment.ts
+android/app/src/main/AndroidManifest.xml
+```
-First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
+**Docs**: [Bridgefy SDK](https://docs.bridgefy.me/) | [Android](https://github.com/bridgefy/sdk-android) | [iOS](https://github.com/bridgefy/sdk-ios)
-To start Metro, run the following command from the _root_ of your React Native project:
+---
-```bash
-# using npm
-npm start
+## 🛠️ Prerequisites
-# OR using Yarn
-yarn start
+```
+💻 Node 18+ | RN CLI 11+ | RN 0.73+
+📱 Android Studio (SDK 34) | Xcode 15+
+☕ Java 17 | iOS 13+ devices (NO simulator)
```
-## Step 2: Start your Application
+---
-Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
+## 📋 Step-by-Step Setup
-### For Android
+### Step 1: Environment
+```
+npx react-native doctor # Fix issues
+```
-```bash
-# using npm
-npm run android
+### Step 2: Android Gradle + Desugaring (`android/app/build.gradle`)
+```gradle
+android {
+ compileSdk 34
+ defaultConfig {
+ applicationId "me.bridgefy.android.sample" # ✅
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ coreLibraryDesugaringEnabled true # ✅ CRITICAL
+ }
+}
+
+dependencies {
+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' # ✅
+}
+```
-# OR using Yarn
-yarn android
+### Step 3: Android Permissions + Service (`android/app/src/main/AndroidManifest.xml`)
+```xml
+
+
+
+
+
+
+
+
```
-### For iOS
+### Step 4: iOS Permissions (`ios/BridgefySample/Info.plist`)
+```xml
+NSBluetoothAlwaysUsageDescription
+Bridgefy uses Bluetooth for offline messaging
+NSLocationWhenInUseUsageDescription
+Bluetooth scanning requires location access
+```
+### Step 5: Clean & Build
```bash
-# using npm
-npm run ios
-
-# OR using Yarn
-yarn ios
+yarn clean # Custom script or:
+rm -rf node_modules ios/Pods
+yarn install && cd ios && pod install && cd ..
+cd android && ./gradlew clean && cd ..
```
-If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
-
-This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
+---
+
+## 🎮 Example Code (`App.tsx`)
+
+```tsx
+import React, { useEffect, useState } from 'react';
+import { View, Text, Button, FlatList, Alert } from 'react-native';
+import Bridgefy, {
+ BridgefyPropagationProfile,
+ BridgefyOperationMode,
+} from 'bridgefy-react-native';
+
+export default function App() {
+ const [status, setStatus] = useState({ initialized: false, started: false });
+ const [peers, setPeers] = useState([]);
+ const [userId, setUserId] = useState('');
+
+ useEffect(() => {
+ Bridgefy.onConnectedPeers(({ peers }) => setPeers(peers));
+ Bridgefy.onReceiveData(({ data }) => Alert.alert('📨 Received', data));
+
+ return () => Bridgefy.removeAllListeners();
+ }, []);
+
+ const init = async () => {
+ await Bridgefy.initialize('YOUR_API_KEY_HERE', true, BridgefyOperationMode.HYBRID);
+ setStatus(s => ({ ...s, initialized: true }));
+ };
+
+ const start = async () => {
+ const id = await Bridgefy.currentUserId();
+ setUserId(id);
+ await Bridgefy.start(id, BridgefyPropagationProfile.REALTIME);
+ setStatus(s => ({ ...s, started: true }));
+ const peers = await Bridgefy.connectedPeers();
+ setPeers(peers);
+ };
+
+ const broadcast = () => Bridgefy.sendBroadcast(`Hello from ${userId}!`);
+
+ return (
+
+ Bridgefy Mesh Demo
+
+
+
+
+
+ User ID: {userId.slice(0, 8)}...
+ Status: {status.initialized ? '✅ Init' : '❌'} | {status.started ? '✅ Started' : '❌'}
+
+ Peers ({peers.length}):
+ 👥 {item.slice(0, 8)}... }
+ style={{ flex: 1 }}
+ />
+
+ );
+}
+```
-## Step 3: Modifying your App
+**Replace `YOUR_API_KEY_HERE`** with your key!
-Now that you have successfully run the app, let's modify it.
+---
-1. Open `App.tsx` in your text editor of choice and edit some lines.
-2. For **Android**: Press the R key twice or select **"Reload"** from the **Developer Menu** (Ctrl + M (on Window and Linux) or Cmd ⌘ + M (on macOS)) to see your changes!
+## ▶️ Run & Test
- For **iOS**: Hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes!
+```bash
+# Terminal 1: Metro
+yarn start
-## Congratulations! :tada:
+# Terminal 2: Android (2+ physical devices <50m)
+yarn android
-You've successfully run and modified your React Native App. :partying_face:
+# Terminal 3: iOS (real devices)
+yarn ios
+```
-### Now what?
+**Success indicators**:
+- ✅ Init success (no license errors)
+- ✅ Start → User ID shown
+- ✅ Nearby devices → Peers list populates
+- ✅ Broadcast → Alerts on receiving devices
-- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
-- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
+---
-# Troubleshooting
+## ⚠️ Common Issues & Fixes
-If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
+| Error | Cause | Fix |
+|-------|-------|-----|
+| **Desugaring crash** | Missing Gradle config | Add `coreLibraryDesugaringEnabled true` |
+| **SERVICE_NOT_STARTED** | No manifest service | Add `` |
+| **Bluetooth denied** | Permissions | Request 6 perms runtime |
+| **No peers** | Simulator/distance | **Real devices** <50m |
+| **License expired** | Wrong key | Valid key for `me.bridgefy.android.sample` |
-# Learn More
+**Debug**:
+```bash
+adb logcat | grep Bridgefy # Android
+# Xcode console (iOS)
+```
-To learn more about React Native, take a look at the following resources:
+---
-- [React Native Website](https://reactnative.dev) - learn more about React Native.
-- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
-- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
-- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
-- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
+*Made with ❤️ by Bridgefy – Offline mesh networking for everyone.*
diff --git a/example/assets/bridgefylogo1.svg b/example/assets/bridgefylogo1.svg
new file mode 100644
index 0000000..f7c01e8
--- /dev/null
+++ b/example/assets/bridgefylogo1.svg
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/assets/usecasemain.png b/example/assets/usecasemain.png
new file mode 100644
index 0000000..01d2a7b
Binary files /dev/null and b/example/assets/usecasemain.png differ
diff --git a/example/src/BridgefyEventStore.ts b/example/src/BridgefyEventStore.ts
index 675fc01..bde061b 100644
--- a/example/src/BridgefyEventStore.ts
+++ b/example/src/BridgefyEventStore.ts
@@ -289,26 +289,6 @@ export const setupBridgefyEventListeners = (Bridgefy: any) => {
);
});
- // License Events
- Bridgefy.onUpdateLicense(() => {
- addBridgefyEvent(
- 'success',
- BridgefyEvents.BRIDGEFY_DID_UPDATE_LICENSE,
- 'bridgefyDidUpdateLicense',
- 'License updated successfully'
- );
- });
-
- Bridgefy.onFailToUpdateLicense((error: BridgefyError) => {
- addBridgefyEvent(
- 'error',
- BridgefyEvents.BRIDGEFY_DID_FAIL_TO_UPDATE_LICENSE,
- 'bridgefyDidFailToUpdateLicense',
- `Failed to update license: ${error.message}`,
- error
- );
- });
-
// Session Events
Bridgefy.onDestroySession?.(() => {
addBridgefyEvent(
diff --git a/example/src/entities/iStatus.ts b/example/src/entities/iStatus.ts
index 63c974b..a2b19bc 100644
--- a/example/src/entities/iStatus.ts
+++ b/example/src/entities/iStatus.ts
@@ -1,4 +1,6 @@
-import type { BridgefyOperationMode } from 'bridgefy-react-native';
+import type {
+ BridgefyOperationMode,
+} from 'bridgefy-react-native';
export type SDKState =
| 'uninitialized'
@@ -17,6 +19,7 @@ export interface SDKStatusSnapshot {
connectedPeers: string[];
propagationProfile: string;
operationStatus: BridgefyOperationMode;
+ bridgefyLicenseInfo: string;
loading: boolean;
error?: string;
}
diff --git a/example/src/hooks/useSDKStatus.ts b/example/src/hooks/useSDKStatus.ts
index bd577ac..bfeab86 100644
--- a/example/src/hooks/useSDKStatus.ts
+++ b/example/src/hooks/useSDKStatus.ts
@@ -26,9 +26,10 @@ export const useSDKStatus = () => {
isStarted: false,
userId: '',
connectedPeers: [],
- propagationProfile: BridgefyPropagationProfile.STANDARD,
+ propagationProfile: BridgefyPropagationProfile.REALTIME,
+ bridgefyLicenseInfo: '',
operationStatus:
- BridgefyOperationMode.FOREGROUND.toUpperCase() as BridgefyOperationMode,
+ BridgefyOperationMode.HYBRID.toUpperCase() as BridgefyOperationMode,
loading: false,
});
@@ -218,7 +219,8 @@ export const useSDKStatus = () => {
isStarted: false,
userId: '',
connectedPeers: [],
- propagationProfile: BridgefyPropagationProfile.STANDARD,
+ propagationProfile: BridgefyPropagationProfile.REALTIME,
+ bridgefyLicenseInfo: '',
operationStatus:
BridgefyOperationMode.FOREGROUND.toUpperCase() as BridgefyOperationMode,
loading: false,
diff --git a/example/src/repositories/implChatRepository.ts b/example/src/repositories/implChatRepository.ts
index 2689350..a970564 100644
--- a/example/src/repositories/implChatRepository.ts
+++ b/example/src/repositories/implChatRepository.ts
@@ -45,7 +45,6 @@ export class ChatRepository implements IChatRepository {
});
Bridgefy.onStart((event) => {
- console.log('Bridgefy started with user ID:', event.userId);
this.eventHandlers.onUserIdChanged?.(event.userId);
});
}
diff --git a/example/src/repositories/implSDKRepository.ts b/example/src/repositories/implSDKRepository.ts
index fe70bd3..dd8cf69 100644
--- a/example/src/repositories/implSDKRepository.ts
+++ b/example/src/repositories/implSDKRepository.ts
@@ -1,4 +1,5 @@
import Bridgefy, {
+ type BridgefyLicenseInfo,
BridgefyOperationMode,
BridgefyPropagationProfile,
} from 'bridgefy-react-native';
@@ -16,6 +17,17 @@ export class SDKRepository implements ISDKRepository {
let connectedPeers: string[] = [];
let operationStatus: BridgefyOperationMode =
BridgefyOperationMode.FOREGROUND.toUpperCase() as BridgefyOperationMode;
+ let licenseExpirationDate: BridgefyLicenseInfo | null = null;
+ let exp: string = '';
+
+ if (isInitialized) {
+ licenseExpirationDate = await Bridgefy.licenseExpirationDate();
+ if (licenseExpirationDate.isValid) {
+ exp =
+ 'Bridgefy license valid at ' +
+ new Date(licenseExpirationDate.expirationDate).toDateString();
+ }
+ }
if (isStarted) {
userId = await Bridgefy.currentUserId();
@@ -30,7 +42,8 @@ export class SDKRepository implements ISDKRepository {
isStarted,
userId,
connectedPeers,
- propagationProfile: BridgefyPropagationProfile.STANDARD,
+ bridgefyLicenseInfo: exp,
+ propagationProfile: BridgefyPropagationProfile.REALTIME,
operationStatus,
loading: false,
};
@@ -159,35 +172,29 @@ export class SDKRepository implements ISDKRepository {
this.eventHandlers = handlers;
Bridgefy.onStart((event) => {
- console.log('Bridgefy started:', event.userId);
this.eventHandlers.onStart?.(event.userId);
});
Bridgefy.onStop(() => {
- console.log('Bridgefy stopped');
this.eventHandlers.onStop?.();
});
Bridgefy.onConnect((event) => {
- console.log('Peer connected:', event.userId);
this.eventHandlers.onPeerConnect?.(event.userId);
this.updatePeers();
});
Bridgefy.onDisconnect((event) => {
- console.log('Peer disconnected:', event.userId);
this.eventHandlers.onPeerDisconnect?.(event.userId);
this.updatePeers();
});
Bridgefy.onConnectedPeers((event) => {
const peers = Array.isArray(event.peers) ? event.peers : [];
- console.log('Connected peers updated:', peers.length);
this.eventHandlers.onPeersUpdated?.(peers);
});
Bridgefy.onFailToStart((error) => {
- console.error('Failed to start Bridgefy:', error);
const err = new Error(
(error as any)?.message ?? 'Bridgefy failed to start'
);
diff --git a/example/src/screens/StatusScreen.tsx b/example/src/screens/StatusScreen.tsx
index 3a93830..9a81d27 100644
--- a/example/src/screens/StatusScreen.tsx
+++ b/example/src/screens/StatusScreen.tsx
@@ -48,7 +48,7 @@ export default function StatusScreen() {
return (
- Status
+ {'Status'}
{/* Status Cards */}
@@ -63,26 +63,47 @@ export default function StatusScreen() {
/>
)}
-
-
-
-
+ {/* License expiration date */}
+ {status.isInitialized &&
+ !status.loading &&
+ status.bridgefyLicenseInfo && (
+
+ )}
+
+ {/* Connected Peers */}
+ {status.isStarted && status.connectedPeers.length > 0 && (
+
+ )}
+
+ {/* Propagation profile */}
+ {status.isStarted && (
+
+ )}
+ {/* Operation mode */}
+ {status.isStarted && (
+
+ )}
+
{/* Control Buttons */}
- Controls
+ {'Controls'}
{!status.isInitialized && (
-
{/* Peers List */}
-
{/* eslint-disable-next-line react-native/no-inline-styles */}
diff --git a/ios/BridgefyReactNativeModule.swift b/ios/BridgefyReactNativeModule.swift
index 82a8487..4294a05 100644
--- a/ios/BridgefyReactNativeModule.swift
+++ b/ios/BridgefyReactNativeModule.swift
@@ -481,7 +481,7 @@ class BridgefyReactNative: RCTEventEmitter, BridgefyDelegate {
}
let info: ErrorInfo
switch bridgefyError {
- case .licenseError(let code, let data): info = .init(type: "licenseError", details: code)
+ case .licenseError(let code, _): info = .init(type: "licenseError", details: code)
case .storageError(let code): info = .init(type: "storageError", details: code)
case .encodingError(let code): info = .init(type: "encodingError", details: code)
case .encryptionError(let code): info = .init(type: "encryptionError", details: code)
diff --git a/package.json b/package.json
index a945cc1..9f5099e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "bridgefy-react-native",
- "version": "1.1.9",
+ "version": "1.2.0",
"description": "Bridgefy React Native Library",
"main": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
diff --git a/src/NativeBridgefy.ts b/src/NativeBridgefy.ts
index af37971..fbc6335 100644
--- a/src/NativeBridgefy.ts
+++ b/src/NativeBridgefy.ts
@@ -48,10 +48,6 @@ export enum BridgefyEvents {
BRIDGEFY_DID_FAIL_SENDING_MESSAGE = 'bridgefyDidFailSendingMessage',
BRIDGEFY_DID_RECEIVE_DATA = 'bridgefyDidReceiveData',
BRIDGEFY_MESSAGE_RECEIVED = 'bridgefyMessageReceived',
-
- // License Events
- BRIDGEFY_DID_UPDATE_LICENSE = 'bridgefyDidUpdateLicense',
- BRIDGEFY_DID_FAIL_TO_UPDATE_LICENSE = 'bridgefyDidFailToUpdateLicense',
}
export enum BridgefyErrorCode {
diff --git a/src/index.tsx b/src/index.tsx
index bdb8102..42ea5fd 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -176,7 +176,7 @@ export class Bridgefy {
}
/**
- * Update license
+ * @deprecated since version 2.0
*/
async updateLicense(): Promise {
return BridgefyReactNative.updateLicense();
@@ -332,20 +332,6 @@ export class Bridgefy {
listener
);
}
-
- onUpdateLicense(listener: () => void) {
- return this.addEventListener(
- BridgefyEvents.BRIDGEFY_DID_UPDATE_LICENSE,
- listener
- );
- }
-
- onFailToUpdateLicense(listener: (error: BridgefyError) => void) {
- return this.addEventListener(
- BridgefyEvents.BRIDGEFY_DID_FAIL_TO_UPDATE_LICENSE,
- listener
- );
- }
}
// Export default instance for convenience