GithubHelp home page GithubHelp logo

fly3366 / react-native-system-broadcast Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 5.0 53 KB

Send/Listen broadcast from native with emiter

License: GNU General Public License v3.0

JavaScript 3.76% Java 96.24%

react-native-system-broadcast's Introduction

react-native-system-broadcast

Send/Listen broadcast from native with emiter. NOTICE:

  • for React Native > 0.21 use
  • for React Native < 0.21 do NOT use

Setup

Fast and easy:

npm install react-native-system-broadcast --save
react-native link react-native-system-broadcast

Or manual: add the latest version as dependeny to your package.json.

{
  "name": "YourProject",
  ...
  },
  "dependencies": {
    ...
    "react-native-system-broadcast": "^0.1.20",
    ...
  }

iOS

NOT support

Android

  • In the settings.gradle
      include ':react-native-system-broadcast', ':app'
      project(':react-native-system-broadcast').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-system-broadcast/android')
    
  • In the build.gradle
      compile project(':react-native-system-broadcast')
    
  • In MainApplication.java
      import top.litop.RroadCast;
      ...
      @Override
      protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
          ...
          new RroadCastReactPackage(),
          ...
        );
      }
      ...
    

Usage

import RroadCast from 'react-native-system-broadcast';
...
RroadCast.sync();//You can reveice all native system broadcast in react event system
RroadCast.unSnyc();//Place use it on APP has stopped
RroadCast.sendBroadCast(action,json);//json need to like this.eg. {key:value,nokey:novalue}
RroadCast.on(action);//Connect action from native to react event system
RroadCast.remove(action);//Disconnect action from native to react event system
RroadCast.removeAll();//Place use it on APP has stopped
...
DeviceEventEmiter.addEventListener(action,(dataFromExtras)=>{
    //do something
})
...

Warning

This plugin NOT safe for something like broadcast with permission.

Versioning

This project uses semantic versioning: MAJOR.MINOR.PATCH. This means that releases within the same MAJOR version are always backwards compatible. For more info see semver.org.

react-native-system-broadcast's People

Contributors

fly3366 avatar

Stargazers

Shayne Wang avatar  avatar  avatar qyhongfan avatar  avatar Shihua Du avatar

Watchers

James Cloos avatar

react-native-system-broadcast's Issues

Examples

Do you have examples how to connect to a specific MHz?

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.