react-native-wol
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-native-wol package

1.0.2 • Public • Published

react-native-wol

React native module for sending Wake-On-Lan magic packets. Currently, works for Android only!

Getting started

$ npm install react-native-wol --save

Mostly automatic installation

$ react-native link react-native-wol

Manually Link Android

  • In android/setting.gradle
...
include ':react-native-wol'
project(':react-native-wol').projectDir = new File(settingsDir, '../react-native-wol/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':react-native-wol')
}
  • In MainApplication.java
 
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactPackage;
...
import com.reactlibrary.WolPackage; // <------ Add this! 
...
 
public class MainActivity extends Activity implements ReactApplication {
...
    @Override
    protected List<ReactPackage> getPackages() {
      ...
      packages.add(new WolPackage());
      ...
    }
}

Usage

import Wol from 'react-native-wol';
 
Wol.send("192.168.0.255", "20:17:42:67:DD:18", (res, msg) => {
    console.log(res, msg)
})

Package Sidebar

Install

npm i react-native-wol

Weekly Downloads

10

Version

1.0.2

License

MIT

Unpacked Size

438 kB

Total Files

52

Last publish

Collaborators

  • zom688