A React Native wrapper for Google Nearby Messages API enabling cross-device communication via Bluetooth, BLE, WiFi, and near-ultrasonic audio.
react-native-google-nearby-messages is a React Native library that provides an asynchronous wrapper for the Google Nearby Messages API, enabling proximity-based communication between Android and iOS devices. It allows developers to broadcast and receive small payloads like strings using multiple discovery mediums such as Bluetooth, BLE, WiFi, and near-ultrasonic audio. The library simplifies integrating Google's proximity features into cross-platform mobile applications with a clean React Native API.
React Native developers building mobile applications that require device-to-device communication based on physical proximity, such as location-based services, peer-to-peer messaging, or interactive installations. It is also useful for developers interested in learning how to integrate Swift into React Native modules.
Developers choose this library because it offers a seamless, promise-based API with React hooks for simplified integration, reducing the complexity of directly using the native Google Nearby Messages API. Its cross-platform support with autolinking for React Native 0.60+ and flexibility in discovery modes and mediums provide a practical solution for implementing proximity features without managing platform-specific code.
📲 Communicate with nearby devices using Bluetooth, BLE, WiFi and near-ultrasonic audio. Broadcast and receive small payloads (like strings) using the easy-to-use React Native API!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Android and iOS with autolinking for React Native 0.60+, minimizing platform-specific code as highlighted in the installation section.
Enables communication via Bluetooth, BLE, WiFi, and audio, providing versatile options for proximity-based interactions as described in the key features.
Includes hooks like useNearbyPublication and useNearbySubscription, which simplify state management and automatically handle cleanup on component unmount, as shown in the usage examples.
Offers awaitable native invocations for asynchronous operations, making the code cleaner and easier to reason about, as demonstrated in the publishing and subscribing snippets.
Requires manual removal of the Assets.car file after each pod install due to a bug in the Google NearbyMessages pod, as noted in the installation warning, adding maintenance overhead.
Developers must explicitly call functions to unpublish, disconnect, and remove listeners, as the library does not handle this automatically, increasing the risk of memory leaks and app crashes.
Bluetooth permission and availability checks are experimental and differ between iOS and Android, leading to potential inconsistencies and crashes, as mentioned in the troubleshooting section.