react-native-printer-imin 0.10.6 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,49 +1,108 @@
1
- # react-native-printer-imin
2
-
3
- Native Module For iMin Printer SDK Plugin
4
-
5
- ## Installation
6
-
7
- ```sh
8
- npm install react-native-printer-imin
9
- ```
10
-
11
- ## Usage
12
-
13
- ```js
14
- import PrinterImin from 'react-native-printer-imin';
15
-
16
- // ...
17
- PrinterImin.initPrinter();
18
-
19
- PrinterImin.getPrinterStatus().then((info) => {
20
- console.log(info);
21
- });
22
-
23
- PrinterImin.printText('hello world');
24
- ```
25
-
26
- ## Contributing
27
-
28
- See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
29
-
30
- ## License
31
-
32
- MIT
33
-
34
- ---
35
-
36
- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
37
- # 更新0.10.5 版本 Updated to version 0.10.5
38
- 更新内容 适配A15 Update details: Adapted for A15
39
- # 更新0.10.4版本 Updated to version 0.10.4
40
- 更新内容: 更新版本号 Update details: Updated version number
41
- # 更新0.10.3版本 Updated to version 0.10.3
42
- fix: adapt .so file for android 16k page, update SDK to iminPrinterSDK-15_V1.3.2_2505261539.jar
43
- 更新内容:fix: all->适配.so文件安卓16k页面,更新SDK:iminPrinterSDK-15_V1.3.2_2505261539.jar
44
- # 更新版本号0.10.2
45
- # 更新0.10.1版本
46
- # 新增标签打印api
47
- # 编辑 package.json 文件,将 "version": "0.8.0" 更新为 "version": "0.9.0"
48
-
49
-
1
+ # react-native-printer-imin
2
+
3
+ Native Module For iMin Printer SDK Plugin
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-printer-imin
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import PrinterImin from 'react-native-printer-imin';
15
+
16
+ // Initialize printer
17
+ await PrinterImin.initPrinter();
18
+
19
+ // Check printer status
20
+ const status = await PrinterImin.getPrinterStatus();
21
+ console.log(status);
22
+
23
+ // Print text
24
+ await PrinterImin.printText('Hello World');
25
+ ```
26
+
27
+ ## Documentation
28
+
29
+ 📚 **Complete documentation is available in multiple languages:**
30
+
31
+ ### 🇨🇳 中文文档 (Chinese Documentation)
32
+
33
+ | Document | Description |
34
+ |----------|-------------|
35
+ | [📖 文档中心](./docs/README.md) | 主要文档中心 |
36
+ | [🚀 快速开始](./docs/quick-start.md) | 5分钟快速上手 |
37
+ | [⚙️ 安装指南](./docs/installation-guide.md) | 详细安装配置说明 |
38
+ | [📋 API参考](./docs/api-reference.md) | 完整API文档 |
39
+ | [👨‍💻 开发者指南](./docs/developer-guide.md) | 深入开发指导 |
40
+ | [💡 使用示例](./docs/examples.md) | 实际应用场景示例 |
41
+ | [🔄 迁移指南](./docs/migration-guide.md) | 版本升级指导 |
42
+ | [❓ 常见问题](./docs/faq.md) | 常见问题解答 |
43
+
44
+ ### 🇺🇸 English Documentation
45
+
46
+ | Document | Description |
47
+ |----------|-------------|
48
+ | [📖 Documentation Center](./docs/en/README.md) | Main documentation hub |
49
+ | [🚀 Quick Start](./docs/en/quick-start.md) | Get started in 5 minutes |
50
+ | [⚙️ Installation Guide](./docs/en/installation-guide.md) | Detailed setup instructions |
51
+ | [📋 API Reference](./docs/en/api-reference.md) | Complete API documentation |
52
+ | [👨‍💻 Developer Guide](./docs/en/developer-guide.md) | Advanced development guide |
53
+ | [❓ FAQ](./docs/en/faq.md) | Frequently asked questions |
54
+
55
+ ### Quick Links
56
+
57
+ - **Example App**: [example/](./example/)
58
+ - **GitHub Issues**: [Report Issues](https://github.com/iminsoftware/react-native-printer-imin/issues)
59
+
60
+ ## Features
61
+
62
+ - ✅ **Text Printing** - Multiple fonts, styles, and alignments
63
+ - ✅ **Image Printing** - URL and local images with size control
64
+ - ✅ **QR Code Printing** - Customizable size, error correction, and alignment
65
+ - ✅ **Barcode Printing** - Multiple barcode formats supported
66
+ - ✅ **Table Printing** - Flexible column layouts
67
+ - ✅ **Label Printing** - SDK 2.0 exclusive feature
68
+ - ✅ **Device Control** - Paper cutting, cash drawer, status monitoring
69
+
70
+ ## Supported Devices
71
+
72
+ ### Handheld Finance Series
73
+ - M2-202, M2-203, M2 Pro
74
+ - Swift 1, Swift 2, Swift 2 Pro, Swift 2 Ultra, Swift 1 Pro
75
+
76
+ ### Tablet Terminal Series
77
+ - M2 Max, D1, D1 Pro
78
+ - Falcon 1, Swan 2, Falcon 2, Falcon 2 Pro, Falcon 1 Pro, Swan 2 Pro, Heron 1, Heron 1 mini
79
+
80
+ ### Desktop POS Equipment
81
+ - D4, Swan 2, Falcon 2
82
+
83
+ ## Contributing
84
+
85
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
86
+
87
+ ## License
88
+
89
+ MIT
90
+
91
+ ---
92
+
93
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
94
+ # 更新0.10.7 版本 Updated to version 0.10.5
95
+ 更新内容 : 修复已知bug Update details: fix bug
96
+ # 更新0.10.5 版本 Updated to version 0.10.5
97
+ 更新内容 : 适配A15 Update details: Adapted for A15
98
+ # 更新0.10.4版本 Updated to version 0.10.4
99
+ 更新内容: 更新版本号 Update details: Updated version number
100
+ # 更新0.10.3版本 Updated to version 0.10.3
101
+ fix: adapt .so file for android 16k page, update SDK to iminPrinterSDK-15_V1.3.2_2505261539.jar
102
+ 更新内容:fix: all->适配.so文件安卓16k页面,更新SDK:iminPrinterSDK-15_V1.3.2_2505261539.jar
103
+ # 更新版本号0.10.2
104
+ # 更新0.10.1版本
105
+ # 新增标签打印api
106
+ # 编辑 package.json 文件,将 "version": "0.8.0" 更新为 "version": "0.9.0"
107
+
108
+
@@ -1,3 +1,6 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
2
  package="com.printerimin">
3
- </manifest>
3
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
4
+ <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
5
+
6
+ </manifest>
@@ -1625,11 +1625,12 @@ public class PrinterIminModule extends ReactContextBaseJavaModule {
1625
1625
  try {
1626
1626
  if (iminPrintUtils == null) {
1627
1627
  String text = config.getString("text");
1628
+ Log.d("printText===>","text===> "+text);
1628
1629
  if (config.hasKey("align")) {
1629
1630
  int align = config.getInt("align");
1630
- PrinterHelper.getInstance().printTextBitmapWithAli(text + "\n", align, null);
1631
+ PrinterHelper.getInstance().printTextBitmapWithAli(text, align, null);
1631
1632
  } else {
1632
- PrinterHelper.getInstance().printTextBitmap(text + "\n", null);
1633
+ PrinterHelper.getInstance().printTextBitmap(text, null);
1633
1634
  }
1634
1635
  }
1635
1636
  promise.resolve(null);
@@ -2035,7 +2036,13 @@ public class PrinterIminModule extends ReactContextBaseJavaModule {
2035
2036
  mBroadcastReceiver = createChargingStateBroadcastReceiver();
2036
2037
  intentFilter.addAction(ACTION_PRITER_STATUS_CHANGE);
2037
2038
  intentFilter.addAction(ACTION_POGOPIN_STATUS_CHANGE);
2038
- getReactApplicationContext().registerReceiver(mBroadcastReceiver, intentFilter);
2039
+
2040
+ // For Android 13+ (API 33+), we need to specify RECEIVER_NOT_EXPORTED
2041
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
2042
+ getReactApplicationContext().registerReceiver(mBroadcastReceiver, intentFilter, Context.RECEIVER_NOT_EXPORTED);
2043
+ } else {
2044
+ getReactApplicationContext().registerReceiver(mBroadcastReceiver, intentFilter);
2045
+ }
2039
2046
  }
2040
2047
 
2041
2048
  @ReactMethod
package/package.json CHANGED
@@ -1,168 +1,171 @@
1
- {
2
- "name": "react-native-printer-imin",
3
- "version": "0.10.6",
4
- "description": "Native Module For iMin Printer SDK Plugin",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/src/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
10
- "files": [
11
- "src",
12
- "lib",
13
- "android",
14
- "ios",
15
- "cpp",
16
- "*.podspec",
17
- "!ios/build",
18
- "!android/build",
19
- "!android/gradle",
20
- "!android/gradlew",
21
- "!android/gradlew.bat",
22
- "!android/local.properties",
23
- "!**/__tests__",
24
- "!**/__fixtures__",
25
- "!**/__mocks__",
26
- "!**/.*"
27
- ],
28
- "scripts": {
29
- "example": "yarn workspace react-native-printer-imin-example",
30
- "test": "jest",
31
- "typecheck": "tsc --noEmit",
32
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
34
- "prepare": "bob build",
35
- "release": "release-it"
36
- },
37
- "keywords": [
38
- "react-native",
39
- "ios",
40
- "android"
41
- ],
42
- "repository": "https://github.com/iminsoftware/react-native-printer-imin",
43
- "author": "iminsoftware <softwareteam@imin.sg> (https://github.com/iminsoftware)",
44
- "license": "MIT",
45
- "bugs": {
46
- "url": "https://github.com/iminsoftware/react-native-printer-imin/issues"
47
- },
48
- "homepage": "https://github.com/iminsoftware/react-native-printer-imin#readme",
49
- "publishConfig": {
50
- "registry": "https://registry.npmjs.org/"
51
- },
52
- "devDependencies": {
53
- "@commitlint/cli": "17.0.2",
54
- "@commitlint/config-conventional": "17.0.2",
55
- "@evilmartians/lefthook": "^1.5.0",
56
- "@react-native/eslint-config": "^0.72.2",
57
- "@release-it/conventional-changelog": "^5.0.0",
58
- "@types/jest": "^28.1.2",
59
- "@types/react": "~17.0.21",
60
- "@types/react-native": "0.70.0",
61
- "@typescript-eslint/eslint-plugin": "^5.62.0",
62
- "@typescript-eslint/parser": "^5.62.0",
63
- "commitlint": "^17.0.2",
64
- "del-cli": "^5.0.0",
65
- "eslint": "^8.4.1",
66
- "eslint-config-prettier": "^8.5.0",
67
- "eslint-plugin-prettier": "^4.0.0",
68
- "jest": "^28.1.1",
69
- "prettier": "^2.0.5",
70
- "react": "18.2.0",
71
- "react-native": "0.72.6",
72
- "react-native-builder-bob": "^0.20.0",
73
- "release-it": "^15.0.0",
74
- "rn-fetch-blob": "^0.12.0",
75
- "turbo": "^1.10.7",
76
- "typescript": "^5.0.2"
77
- },
78
- "resolutions": {
79
- "@types/react": "17.0.21"
80
- },
81
- "peerDependencies": {
82
- "react": "*",
83
- "react-native": "*"
84
- },
85
- "workspaces": [
86
- "example"
87
- ],
88
- "packageManager": "yarn@3.6.1",
89
- "engines": {
90
- "node": ">= 16.0.0"
91
- },
92
- "jest": {
93
- "preset": "react-native",
94
- "modulePathIgnorePatterns": [
95
- "<rootDir>/example/node_modules",
96
- "<rootDir>/lib/"
97
- ]
98
- },
99
- "commitlint": {
100
- "extends": [
101
- "@commitlint/config-conventional"
102
- ]
103
- },
104
- "release-it": {
105
- "git": {
106
- "commitMessage": "chore: release ${version}",
107
- "tagName": "v${version}"
108
- },
109
- "npm": {
110
- "publish": true
111
- },
112
- "github": {
113
- "release": true
114
- },
115
- "plugins": {
116
- "@release-it/conventional-changelog": {
117
- "preset": "angular"
118
- }
119
- }
120
- },
121
- "eslintConfig": {
122
- "root": true,
123
- "extends": [
124
- "@react-native",
125
- "prettier"
126
- ],
127
- "rules": {
128
- "prettier/prettier": [
129
- "error",
130
- {
131
- "quoteProps": "consistent",
132
- "singleQuote": true,
133
- "tabWidth": 2,
134
- "trailingComma": "es5",
135
- "useTabs": false
136
- }
137
- ]
138
- }
139
- },
140
- "eslintIgnore": [
141
- "node_modules/",
142
- "lib/"
143
- ],
144
- "prettier": {
145
- "quoteProps": "consistent",
146
- "singleQuote": true,
147
- "tabWidth": 2,
148
- "trailingComma": "es5",
149
- "useTabs": false
150
- },
151
- "react-native-builder-bob": {
152
- "source": "src",
153
- "output": "lib",
154
- "targets": [
155
- "commonjs",
156
- "module",
157
- [
158
- "typescript",
159
- {
160
- "project": "tsconfig.build.json"
161
- }
162
- ]
163
- ]
164
- },
165
- "dependencies": {
166
- "react-native-device-info": "^14.0.4"
167
- }
168
- }
1
+ {
2
+ "name": "react-native-printer-imin",
3
+ "version": "0.10.7",
4
+ "description": "Native Module For iMin Printer SDK Plugin",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "*.podspec",
17
+ "!ios/build",
18
+ "!android/build",
19
+ "!android/gradle",
20
+ "!android/gradlew",
21
+ "!android/gradlew.bat",
22
+ "!android/local.properties",
23
+ "!**/__tests__",
24
+ "!**/__fixtures__",
25
+ "!**/__mocks__",
26
+ "!**/.*"
27
+ ],
28
+ "scripts": {
29
+ "example": "yarn workspace react-native-printer-imin-example",
30
+ "test": "jest",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
34
+ "prepare": "bob build",
35
+ "release": "release-it"
36
+ },
37
+ "keywords": [
38
+ "react-native",
39
+ "ios",
40
+ "android"
41
+ ],
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/iminsoftware/react-native-printer-imin.git"
45
+ },
46
+ "author": "iminsoftware <softwareteam@imin.sg> (https://github.com/iminsoftware)",
47
+ "license": "MIT",
48
+ "bugs": {
49
+ "url": "https://github.com/iminsoftware/react-native-printer-imin/issues"
50
+ },
51
+ "homepage": "https://github.com/iminsoftware/react-native-printer-imin#readme",
52
+ "publishConfig": {
53
+ "registry": "https://registry.npmjs.org/"
54
+ },
55
+ "devDependencies": {
56
+ "@commitlint/cli": "17.0.2",
57
+ "@commitlint/config-conventional": "17.0.2",
58
+ "@evilmartians/lefthook": "^1.5.0",
59
+ "@react-native/eslint-config": "^0.72.2",
60
+ "@release-it/conventional-changelog": "^5.0.0",
61
+ "@types/jest": "^28.1.2",
62
+ "@types/react": "~17.0.21",
63
+ "@types/react-native": "0.70.0",
64
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
65
+ "@typescript-eslint/parser": "^5.62.0",
66
+ "commitlint": "^17.0.2",
67
+ "del-cli": "^5.0.0",
68
+ "eslint": "^8.4.1",
69
+ "eslint-config-prettier": "^8.5.0",
70
+ "eslint-plugin-prettier": "^4.0.0",
71
+ "jest": "^28.1.1",
72
+ "prettier": "^2.0.5",
73
+ "react": "18.2.0",
74
+ "react-native": "0.72.6",
75
+ "react-native-builder-bob": "^0.20.0",
76
+ "release-it": "^15.0.0",
77
+ "rn-fetch-blob": "^0.12.0",
78
+ "turbo": "^1.10.7",
79
+ "typescript": "^5.0.2"
80
+ },
81
+ "resolutions": {
82
+ "@types/react": "17.0.21"
83
+ },
84
+ "peerDependencies": {
85
+ "react": "*",
86
+ "react-native": "*"
87
+ },
88
+ "workspaces": [
89
+ "example"
90
+ ],
91
+ "packageManager": "yarn@3.6.1",
92
+ "engines": {
93
+ "node": ">= 16.0.0"
94
+ },
95
+ "jest": {
96
+ "preset": "react-native",
97
+ "modulePathIgnorePatterns": [
98
+ "<rootDir>/example/node_modules",
99
+ "<rootDir>/lib/"
100
+ ]
101
+ },
102
+ "commitlint": {
103
+ "extends": [
104
+ "@commitlint/config-conventional"
105
+ ]
106
+ },
107
+ "release-it": {
108
+ "git": {
109
+ "commitMessage": "chore: release ${version}",
110
+ "tagName": "v${version}"
111
+ },
112
+ "npm": {
113
+ "publish": true
114
+ },
115
+ "github": {
116
+ "release": true
117
+ },
118
+ "plugins": {
119
+ "@release-it/conventional-changelog": {
120
+ "preset": "angular"
121
+ }
122
+ }
123
+ },
124
+ "eslintConfig": {
125
+ "root": true,
126
+ "extends": [
127
+ "@react-native",
128
+ "prettier"
129
+ ],
130
+ "rules": {
131
+ "prettier/prettier": [
132
+ "error",
133
+ {
134
+ "quoteProps": "consistent",
135
+ "singleQuote": true,
136
+ "tabWidth": 2,
137
+ "trailingComma": "es5",
138
+ "useTabs": false
139
+ }
140
+ ]
141
+ }
142
+ },
143
+ "eslintIgnore": [
144
+ "node_modules/",
145
+ "lib/"
146
+ ],
147
+ "prettier": {
148
+ "quoteProps": "consistent",
149
+ "singleQuote": true,
150
+ "tabWidth": 2,
151
+ "trailingComma": "es5",
152
+ "useTabs": false
153
+ },
154
+ "react-native-builder-bob": {
155
+ "source": "src",
156
+ "output": "lib",
157
+ "targets": [
158
+ "commonjs",
159
+ "module",
160
+ [
161
+ "typescript",
162
+ {
163
+ "project": "tsconfig.build.json"
164
+ }
165
+ ]
166
+ ]
167
+ },
168
+ "dependencies": {
169
+ "react-native-device-info": "^14.0.4"
170
+ }
171
+ }