Git Product home page Git Product logo

react-native-quiet's Introduction

react-native-quiet

This is a React Native wrapper around the Quiet Project, which enables the transfer of data using sound as the transfer medium. This has a number of benefits:

  • Super cross-platform. (You just need a microphone and a speaker.)
  • Broadcast to devices within range without pairing.
  • No network connection required.

Quiet can even go ultrasonic, allowing us to communicate without impacting on noise levels that are perceptible by human ears.

Try the awesome online demo here.

๐Ÿš€ Getting started

Using npm:

$ npm install react-native-quiet --save

Using yarn:

yarn add react-native-quiet

Android

This project relies upon the Android NDK; please make sure this is configured within your system path. Android relies upon caching the Quiet Android Project, meaning that we have to manually configure it's visibility to your compiled application. To do this, in your <project-dir>/android/settings.gradle, append the :quiet native project, which is packaged inside of react-native-quiet:

include ':quiet'
project(':quiet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-quiet/android/Transducer/quiet')

Finally, under File > Project Structure, be sure to define your Android NDK location under SDK Location. You can just use the dropdown to select the default location.

iOS

On iOS, after installing be sure to sync your Cocoapods via pod install.

Upgrading

0.1.0

android/settings.xml

include ':quiet'
- project(':quiet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-quiet/android/org.quietmodem.Quiet/quiet')
+ project(':quiet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-quiet/android/Transducer/quiet')

โœ๏ธ Example

This project exposes high level functionality to send and receive messages using near-ultrasound. Simply start the library, use send() to transmit a message string and addListener to listen to receive sent messages. Be careful; you can hear your own messages.

import Quiet from 'react-native-quiet';

// Start listening. (This will ask for microphone permissions!)
(async() => {
  await Quiet.start("ultrasonic-experimental");
  const { unsubscribe } = Quiet
    .addListener(msg => console.warn(msg));
  Quiet.send("hello, world!");
  await new Promise(resolve => setTimeout(resolve, 10000));
  Quiet.stop();
  unsubscribe();
})();

โœŒ๏ธ License

MIT

react-native-quiet's People

Contributors

cawfree 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  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-quiet's Issues

The app is rejected from the app store

Hi,

I was playing with this library and I realized that the app is rejected by App Connect because the file build-c-libraries.sh from QuietModemKit is not signed.

I get a message like this :

Invalid Signature. Code object is not signed at all

Do you have any idea how to solve this issue ?

While excuting react-native run-android in example project it's trowing error

  • What went wrong:
    Could not determine the dependencies of task ':app:preDebugBuild'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :quiet.
Required by:
project :app > project :react-native-quiet
> Unable to find a matching configuration of project :quiet:
- None of the consumable configurations have attributes.

Android: Could not resolve project :quiet.

System:
OS: macOS 10.15
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 264.83 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.2 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.10.3 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

react-native-quiet version 0.0.2

Android build fails after autolink on RN 0.61.5. The node_modules/react-native-quiet/android/org.quietmodem.Quiet directory is empty.

Screen Shot 2019-12-07 at 9 31 39 PM

Wrong package name in the generated PackageList.java

I follow the instruction to setup the project.

The generated /android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:

package com.facebook.react;
...
// react-native-quiet
import org.quietmodem.Quiet.RNQuietPackage;      // ๐Ÿก’ wrong package name here?

public class PackageList {
  ...
}

The correct import statement should be

import io.github.cawfree.quiet.RNQuietPackage;

Podspec link is incorrect

I believe the line in the readme should be:

The line pod 'react-native-quiet', :path => '../node_modules/react-native-quiet/react-native-quiet.podspec' is visible in your Podfile.

Rather than:

The line pod 'react-native-quiet', :path => '../../react-native-quiet.podspec' is visible in your Podfile.

Undefine

And receiving quiet.send is undefined

Is this package still being maintained? (A problem occurred evaluating project ':quiet')

I'm trying to implement this very promising library but I'm getting various errors that don't allow me to finish the build successfully.
Specifically this is what I get:

$ npx react-native run-android
info Starting JS server...
info Installing the app...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\coding\playground\quiet\node_modules\react-native-quiet\android\Transducer\quiet\build.gradle' line: 34

* What went wrong:
A problem occurred evaluating project ':quiet'.
> Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\coding\playground\quiet\node_modules\react-native-quiet\android\Transducer\quiet\build.gradle' line: 34

* What went wrong:
A problem occurred evaluating project ':quiet'.
> Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

    at makeError (D:\coding\playground\quiet\node_modules\execa\index.js:174:9)
    at D:\coding\playground\quiet\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (D:\coding\playground\quiet\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (D:\coding\playground\quiet\node_modules\@react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.

I don't know very much about android development and I hope someone can help me.
Isn't it that these errors perhaps come from using an outdated package?
Thanks in advance.

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.