Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2.05 KB

README2.md

File metadata and controls

62 lines (48 loc) · 2.05 KB

react-native-a-beep

A very lite module to play system sounds and beep for react-native apps (no sound files)

Sponsor by

Go Noter app - Group travel and expenses assistant!

Getting started

$ npm install react-native-a-beep --save

(RN < 0.60) Mostly automatic installation

$ react-native link react-native-a-beep

Manual installation

Using CocoaPods

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

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-a-beep and add RNReactNativeABeep.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNReactNativeABeep.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. 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 the getPackages() method
  1. 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')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-a-beep')
    

Usage

import RNReactNativeABeep from 'react-native-a-beep';

// TODO: What to do with the module?
RNReactNativeABeep;