react-native-bluetooth-share
v1.0.1
Published
Share your react native android app from within the app itself using Bluetooth.
Downloads
3
Readme
React Native Bluetooth Share
Allows you to share your react native app's .apk file via bluetooth.
It looks for the current app's apk file, renames it to the name provided and then sends it via bluetooth to another phone.
It's useful in places where access to internet is limited. Originally created for the Emoyeni app which works completely offline.
Link to Cordova version here
Read more about the plugin on my website
Getting started
$ npm install react-native-bluetooth-share --save
Mostly automatic installation
$ react-native link react-native-bluetooth-share
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNBluetoothSharePackage;
to the imports at the top of the file - Add
new RNBluetoothSharePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-bluetooth-share' project(':react-native-bluetooth-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-share/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-bluetooth-share')
Usage
import RNBluetoothShare from 'react-native-bluetooth-share';
RNBluetoothShare.sendAPK('app_name');