Code Monkey home page Code Monkey logo

react-native-a-beep's Introduction

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!

Install

npm install "react-native-a-beep"

(RN < 0.60) Mostly automatic installation

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

Usage

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

Examples:

<Button onPress={ () => {RNBeep.beep()} } title="Beep Success"></Button>
<Button onPress={ () => {RNBeep.beep(false)} } title="Beep Fail"></Button>
<Button onPress={ () => {RNBeep.PlaySysSound(RNBeep.AndroidSoundIDs.TONE_CDMA_ABBR_ALERT)} } title="Beep Android Custom"></Button>
<Button onPress={ () => {RNBeep.PlaySysSound(41)} } title="Beep Something"></Button>
<Button onPress={ () => {RNBeep.PlaySysSound(RNBeep.iOSSoundIDs.AudioToneBusy)} } title="Beep iOS Custom"></Button>

Happy Beep!

FREE!

react-native-a-beep's People

Contributors

dbcontext avatar dependabot[bot] avatar leemcmullen avatar misioka avatar tao-software avatar trietho avatar triethowvn avatar yoel311 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-a-beep's Issues

Don't hear any sounds on Android

Android version 12
Motorola Edge 30
react-native-a-beep 1.2.0
react-native 0.68.2

Works on IOS but not Android.
I am just using the sample code from the readme.

Android App crash

Fatal Exception: java.lang.RuntimeException: Init failed
at android.media.ToneGenerator.native_setup(ToneGenerator.java)
at android.media.ToneGenerator.(ToneGenerator.java:746)
at com.trietho.RNReactNativeABeepModule.(RNReactNativeABeepModule.java:14)
at com.trietho.RNReactNativeABeepPackage.createNativeModules(RNReactNativeABeepPackage.java:16)
at com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42)
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1347)
at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1318)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1225)
at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1016)
at java.lang.Thread.run(Thread.java:764)

Update the RN version

Error with Conflicts of version

npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"~0.63.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.41.2" from [email protected]
npm ERR! node_modules/react-native-a-beep
npm ERR!   react-native-a-beep@"^1.0.7" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm peer dependancy error

D:__FRN\geoloc\tracking>npm install react-native-a-beep
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR! react-native@"0.68.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.64.1" from [email protected]
npm ERR! node_modules/react-native-a-beep
npm ERR! react-native-a-beep@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\jlouis\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jlouis\AppData\Local\npm-cache_logs\2022-06-17T17_25_03_761Z-debug-0.log

What I would recommand is to put a peer dependancy with ~, and not ^.

Error occured while calling RNBeep.() function

I want a beep sound when there is an alert message occuring in my code

My code spnippet:

else if (dovalue != "") {
      this.showAlertMessage("Failure", "Invalid DO/Invoice");
      RNBeep.beep(false);
      //alert("Delivery order does not exist in this Delivery Note.");
      this.setState({
        DoTextValue: ""
      });
      textInput.focus();
    }

When this alert occurs in my code, instead of the alert and beep sound, I'm receiving the below error
Screenshot_2020-03-24-12-42-34-830_com aurora

Blank screen after install

Hi. After simply add your package to my project he have stopped to work for no reason.

No log, no messages, simply a blank screen after run app. If I remove the package, all is good again.

Some details who I hope help:

I've installed via yarn instead of npm

My app is a bare project, but I use some expo dependencies, like the expo-barcode-scanner.

I'm newbie in react-native, but I have long experience developing in ionic and web apps, so it can be a my problem, but I cant find a reason. In my search I've found some discussions asking for me adding the NDK to the project, I've it did, but the problem persist.

Maybe have some dependency who I need install before use it or some configuration?

Thanks.

Unable to install

"react": "18.0.0",
 "react-native": "0.69.0",

Error during installation

PS C:\Users\Muhammad Yasir\Desktop\Apps\Scanner> npm install "react-native-a-beep"
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.69.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.64.1" from [email protected]
npm ERR! node_modules/react-native-a-beep
npm ERR!   react-native-a-beep@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Muhammad Yasir\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Muhammad Yasir\AppData\Local\npm-cache\_logs\2022-08-31T07_12_05_180Z-debug-0.log
PS C:\Users\Muhammad Yasir\Desktop\Apps\Scanner>

Error running pod install

When I run pod install, I'm getting this:

[!] The RNReactNativeABeep pod failed to validate due to 1 error:
- ERROR | attributes: Missing required attribute homepage.
- WARN | source: The version should be included in the Git tag.

on 0.72.5 issue

hello ,
at yarn run android, from RN 0.72.5,
I get the message
Task :react-native-a-beep:processDebugManifest
package="com.trietho" found in source AndroidManifest.xml: /home/william/logiciels/logiciels-windows/dev_RN-Node-sauv-GIT/modules/module_mlkit_directBarcodeScanning/example/node_modules/react-native-a-beep/android/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.