A very lite module to play system sounds and beep for react-native apps (no sound files)
Go Noter app - Group travel and expenses assistant!
$ npm install react-native-a-beep --save
$ react-native link react-native-a-beep
If the CocoaPods package manager is new to you, please first review its installation guide pod 'RNReactNativeABeep', :path => '../node_modules/react-native-a-beep'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target '_YOUR_PROJECT_TARGET_' do
pod 'RNReactNativeABeep', :path => '../node_modules/react-native-a-beep'
end
cd ios
pod install
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-a-beep
and addRNReactNativeABeep.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativeABeep.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.trietho.RNReactNativeABeepPackage;
to the imports at the top of the file - Add
new RNReactNativeABeepPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-a-beep' project(':react-native-a-beep').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-a-beep/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-a-beep')
import RNReactNativeABeep from 'react-native-a-beep';
// TODO: What to do with the module?
RNReactNativeABeep;