1.0.2 • Published 1 year ago

react-native-suno-zkt-printer v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-suno-zkt-printer

React Native Suno ZKT Printer

Installation

npm install react-native-suno-zkt-printer

Usage

import { ZktPrinter } from 'react-native-suno-zkt-printer';

// ...

const printPdf = async () => {
    if (Platform.OS === 'android') {
      const grantedWriteStorage: PermissionStatus =
        await PermissionsAndroid.request(
          'android.permission.WRITE_EXTERNAL_STORAGE',
          {
            title: 'Yêu cầu quyền ghi dữ liệu',
            message:
              'Cho phép ứng dụng Suno F&B truy xuất ghi dữ liệu để in hóa đơn?',
            buttonNegative: 'Đóng',
            buttonPositive: 'Đồng ý',
          }
        );
      const grantedReadStorage: PermissionStatus =
        await PermissionsAndroid.request(
          'android.permission.READ_EXTERNAL_STORAGE',
          {
            title: 'Yêu cầu quyền đọc dữ liệu',
            message:
              'Cho phép ứng dụng Suno F&B truy xuất đọc dữ liệu để in hóa đơn?',
            buttonNegative: 'Đóng',
            buttonPositive: 'Đồng ý',
          }
        );
      if (
        grantedReadStorage === 'granted' &&
        grantedWriteStorage === 'granted'
      ) {
        const printer = new ZktPrinter();
        try {
          printer.printText('Xin cam on va hen gap lai quy khach !!!');
        } catch (e) {
          console.log('Print error =>', e);
        }
      }
    }
  };

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

1.0.2

1 year ago

1.0.1

1 year ago