diff --git a/README.md b/README.md index b400dce..6c54f66 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,10 @@ _An unofficial React Native library for printing on an EPSON TM printer with the |---| 1. [Installation](./docs/INSTALLATION.md) -3. [API](./docs/API.md) -4. [Expo](./docs/EXPO.md) +2. [API](./docs/API.md) +3. [Examples](./docs/QUICK_START.md) +4. [Supported devices](./docs/SUPPORTED_DEVICES.md) 5. [SDK information (v2.27.0)](./docs/SDK.md) -6. [List of supported printers for Android](./docs/and2270.pdf) -7. [List of supported printers for iOS](./docs/and2270.pdf) -8. [Examples](./docs/QUICK_START.md) ## Sponsoring I'm working on the lib at my free time. If you like the lib and want to support me, you can [buy me a cofee](https://buymeacoffee.com/tr3v3r diff --git a/docs/EXPO.md b/docs/EXPO.md deleted file mode 100644 index ce3529e..0000000 --- a/docs/EXPO.md +++ /dev/null @@ -1,44 +0,0 @@ -# Installation - -```sh -npx expo install react-native-esc-pos-printer -npx expo prebuild -``` - -Modify `app.json`: - -### Android -```JSON -{ - "android": { - "permissions": [ - "android.permission.INTERNET", - "android.permission.BLUETOOTH_SCAN", - "android.permission.BLUETOOTH_CONNECT", - "android.permission.BLUETOOTH", - "android.permission.BLUETOOTH_ADMIN", - "android.permission.ACCESS_FINE_LOCATION", - "android.permission.ACCESS_COARSE_LOCATION", - "android.permission.WRITE_EXTERNAL_STORAGE", - "android.permission.READ_EXTERNAL_STORAGE" - ] - } -} -``` - -See explanation of permissions [here](./androidPermissions.md) - -### iOS - -```JSON -{ - "ios": { - "infoPlist": { - // Set the item in the Information Property List. - "NSBluetoothAlwaysUsageDescription": "Use this to communicate with the printer.", - // When the Bluetooth or USB is used, set the protocol name. Set the protocol name according to the following procedure: - "UISupportedExternalAccessoryProtocols": ["com.epson.escpos"] - } - } -} -``` diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 8ebacec..2d2c147 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -1,5 +1,12 @@ + # Installation +- [Bare React Native](#bare-react-native) +- [Expo](#expo) + + +## Bare React Native + ```sh npm install react-native-esc-pos-printer ``` @@ -10,7 +17,7 @@ or yarn add react-native-esc-pos-printer ``` -## Android +### Android Add the following permissions to `android/app/src/main/AndroidManifest.xml` ```xml @@ -35,7 +42,7 @@ Add the following permissions to `android/app/src/main/AndroidManifest.xml` See explanation of permissions [here](./androidPermissions.md) -## iOS +### iOS ```sh pod install @@ -66,3 +73,47 @@ For iOS13 or later, add Privacy-Bluetooth Always Usage Description. alt="Indoor Building Map Android" height="300" /> + +--- +## Expo + +```sh +npx expo install react-native-esc-pos-printer +npx expo prebuild +``` + +Modify `app.json`: + +### Android +```JSON +{ + "android": { + "permissions": [ + "android.permission.INTERNET", + "android.permission.BLUETOOTH_SCAN", + "android.permission.BLUETOOTH_CONNECT", + "android.permission.BLUETOOTH", + "android.permission.BLUETOOTH_ADMIN", + "android.permission.ACCESS_FINE_LOCATION", + "android.permission.ACCESS_COARSE_LOCATION", + "android.permission.WRITE_EXTERNAL_STORAGE", + "android.permission.READ_EXTERNAL_STORAGE" + ] + } +} +``` + +See explanation of permissions [here](./androidPermissions.md) + +### iOS + +```JSON +{ + "ios": { + "infoPlist": { + "NSBluetoothAlwaysUsageDescription": "Use this to communicate with the printer.", + "UISupportedExternalAccessoryProtocols": ["com.epson.escpos"] + } + } +} +``` diff --git a/docs/QUICK_START.md b/docs/QUICK_START.md index 9915e93..caba49a 100644 --- a/docs/QUICK_START.md +++ b/docs/QUICK_START.md @@ -1,8 +1,25 @@ -# Quick Start Example +# Examples + + +## 1) Simple print Receipt` -See the [example](https://github.com/tr3v3r/react-native-esc-pos-printer/tree/main/example) folder. +Please find full code [here](https://github.com/tr3v3r/react-native-esc-pos-printer/tree/main/example/src/screens/SimplePrint.tsx). + +## 2) Print from React Native View + +Receipt` + +Receipt` + +Please find full code [here](https://github.com/tr3v3r/react-native-esc-pos-printer/tree/main/example/src/screens/PrintFromView.tsx). diff --git a/docs/SUPPORTED_DEVICES.md b/docs/SUPPORTED_DEVICES.md new file mode 100644 index 0000000..6368e21 --- /dev/null +++ b/docs/SUPPORTED_DEVICES.md @@ -0,0 +1,8 @@ +# Supported devices + +## Manufacturer +### - Epson +List of supported printers [here](./and2270.pdf) + +### - Zywell +Not oficially supported, but compatible with EPSON ESC/POS commands.