$ npm install react-native-native-esc-printer-library --save
$ react-native link react-native-native-esc-printer-library
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-native-esc-printer-libraryand addRNNativeEscPrinterLibrary.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNNativeEscPrinterLibrary.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNNativeEscPrinterLibraryPackage;to the imports at the top of the file - Add
new RNNativeEscPrinterLibraryPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-native-esc-printer-library' project(':react-native-native-esc-printer-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-native-esc-printer-library/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-native-esc-printer-library')
- In Visual Studio add the
RNNativeEscPrinterLibrary.slninnode_modules/react-native-native-esc-printer-library/windows/RNNativeEscPrinterLibrary.slnfolder to their solution, reference from their app. - Open up your
MainPage.csapp
- Add
using Native.Esc.Printer.Library.RNNativeEscPrinterLibrary;to the usings at the top of the file - Add
new RNNativeEscPrinterLibraryPackage()to theList<IReactPackage>returned by thePackagesmethod
import RNNativeEscPrinterLibrary from 'react-native-native-esc-printer-library';
// TODO: What to do with the module?
RNNativeEscPrinterLibrary;