Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tr3v3r committed Aug 19, 2024
1 parent 54206b7 commit e2c25b2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 53 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 0 additions & 44 deletions docs/EXPO.md

This file was deleted.

55 changes: 53 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

# Installation

- [Bare React Native](#bare-react-native)
- [Expo](#expo)


## Bare React Native

```sh
npm install react-native-esc-pos-printer
```
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"]
}
}
}
```
21 changes: 19 additions & 2 deletions docs/QUICK_START.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Quick Start Example
# Examples


## 1) Simple print

<img src="../assets/quickprint.png"
alt="Receipt`"
height="300"
/>

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

<img src="../assets/viewShotCode.jpg"
alt="Receipt`"
width="300"
/>

<img src="../assets/viewShotResult.jpg"
alt="Receipt`"
height="300"
/>

Please find full code [here](https://github.com/tr3v3r/react-native-esc-pos-printer/tree/main/example/src/screens/PrintFromView.tsx).
8 changes: 8 additions & 0 deletions docs/SUPPORTED_DEVICES.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit e2c25b2

Please sign in to comment.