This is a React Native companion plugin for using the go-zeroconf-registry in concert with a go-micro based infrastructure. Everything else in this README is subject to change as the plugin is migrated to be a Registry component, rather than pure zeroconf service discovery.
$ npm install react-native-zeroconf-registry --save
$ react-native link react-native-zeroconf-registry
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-zeroconf-registry
and addRNZeroconfRegistry.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNZeroconfRegistry.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import sh.kono.micro.RNZeroconfRegistryPackage;
to the imports at the top of the file - Add
new RNZeroconfRegistryPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-zeroconf-registry' project(':react-native-zeroconf-registry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zeroconf-registry/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-zeroconf-registry')
import RNZeroconfRegistry from 'react-native-zeroconf-registry';
// TODO: What to do with the module?
RNZeroconfRegistry;
Heavily inspired by react-native-zeroconf. Initial implementation is mostly drawn from a fork of that excellent repo.