@rdlabo/capacitor-brotherprint 6.0.2 → 6.0.3

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.
Files changed (3) hide show
  1. package/README.md +42 -38
  2. package/ios/Podfile +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # @rdlabo/capacitor-brotherprint
2
+
2
3
  Capacitor Brother Print is a native Brother Print SDK implementation for iOS & Android. This plugin can use in `QL-820NW` and `QL-800`.
3
4
 
4
5
  ## How to install
6
+
5
7
  ```
6
8
  % npm install @rdlabo/capacitor-brotherprint@git@github.com:rdlabo-team/capacitor-brotherprint.git
7
9
  ```
@@ -16,82 +18,84 @@ import { BrotherPrintOptions } from '@rdlabo/capacitor-brotherprint';
16
18
  @Component({
17
19
  selector: 'brother-print',
18
20
  templateUrl: 'brother.component.html',
19
- styleUrls: ['brother.component.scss']
21
+ styleUrls: ['brother.component.scss'],
20
22
  })
21
23
  export class BrotherComponent {
22
24
  constructor() {
23
25
  // Success to print
24
- BrotherPrint.addListener('onPrint', (info) => {
25
- console.log("onPrint");
26
+ BrotherPrint.addListener('onPrint', info => {
27
+ console.log('onPrint');
26
28
  });
27
29
  // Failed to communication with printer
28
- BrotherPrint.addListener('onPrintError', (info) => {
29
- console.log("onPrintError");
30
+ BrotherPrint.addListener('onPrintError', info => {
31
+ console.log('onPrintError');
30
32
  });
31
33
  // Failed to communication with printer
32
- BrotherPrint.addListener('onPrintFailedCommunication', (info) => {
33
- console.log("onPrintFailedCommunication");
34
+ BrotherPrint.addListener('onPrintFailedCommunication', info => {
35
+ console.log('onPrintFailedCommunication');
34
36
  });
35
37
  }
36
38
  print() {
37
39
  BrotherPrint.printImage({
38
40
  printerType: 'QL-820NW',
39
41
  encodedImage: 'base64 removed mime-type', // base64
40
- } as BrotherPrintOptions)
42
+ } as BrotherPrintOptions);
41
43
  }
42
44
  printWithNetWork() {
43
- const wifi = () => new Promise(resolve => {
44
- BrotherPrint.addListener('onIpAddressAvailable', (info) => {
45
- resolve(info);
45
+ const wifi = () =>
46
+ new Promise(resolve => {
47
+ BrotherPrint.addListener('onIpAddressAvailable', info => {
48
+ resolve(info);
49
+ });
46
50
  });
47
- });
48
51
 
49
- const ble = () => new Promise(resolve => {
50
- BrotherPrint.addListener('onBLEAvailable', (info) => {
51
- resolve(info);
52
+ const ble = () =>
53
+ new Promise(resolve => {
54
+ BrotherPrint.addListener('onBLEAvailable', info => {
55
+ resolve(info);
56
+ });
52
57
  });
53
- });
54
-
55
- Promise.all([wifi(), ble()]).then((values) => {
58
+
59
+ Promise.all([wifi(), ble()]).then(values => {
56
60
  console.log(values);
57
61
  });
58
62
 
59
63
  BrotherPrint.searchWiFiPrinter();
60
64
  BrotherPrint.searchBLEPrinter();
61
- }
65
+ }
62
66
  }
63
67
  ```
64
68
 
65
69
  ## Installation
70
+
66
71
  ```
67
72
  $ npm install --save @rdlabo/capacitor-brotherprint
68
73
  ```
69
74
 
70
75
  ### Android configuration
71
- In file `android/app/src/main/java/**/**/MainActivity.java`, add the plugin to the initialization list:
72
76
 
73
- ```java
74
- import jp.rdlabo.capacitor.plugin.brotherprint.BrotherPrint;
77
+ 1. prepare the following files under the android folder of Capacitor
75
78
 
76
- this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
77
- [...]
78
- add(BrotherPrint.class);
79
- [...]
80
- }});
81
- ```
79
+ - android/BrotherPrintLibrary/BrotherPrintLibrary.aar
80
+ - android/BrotherPrintLibrary/build.gradle
82
81
 
83
- and download `BrotherPrintLibrary.aar` and put to your android project:
84
- https://support.brother.co.jp/j/s/support/html/mobilesdk/guide/getting-started/getting-started-android.html
82
+ `BrotherPrintLibrary.aar` is the Brother Print SDK library. You can get it from the Brother website: https://support.brother.co.jp/j/s/es/dev/ja/mobilesdk/android/index.html?c=jp&lang=ja&navi=offall&comple=on&redirect=on#ver4
85
83
 
86
- ### iOS configuration
87
- comming...
84
+ The contents of `android/BrotherPrintLibrary/build.gradle` is this.
85
+
86
+ ```
87
+ configurations.maybeCreate(“default”)
88
+ artifacts.add(“default”, file('BrotherPrintLibrary.aar'))
89
+ ```
88
90
 
89
- ## Run Demo
90
- 以下デモの動かし方です。
91
+ Add the following to android/settings.gradle.
91
92
 
92
93
  ```
93
- % cd demo/angular
94
- % npm install && npm run build
95
- % npx cap copy
96
- % npx cap open ios
94
+ include ':BrotherPrintLibrary.aar''
95
+ include ':BrotherPrintLibrary'.
96
+ project(':BrotherPrintLibrary').projectDir = new File('. /BrotherPrintLibrary/')
97
97
  ```
98
+
99
+ ### iOS configuration
100
+
101
+ No configuration required.
package/ios/Podfile CHANGED
@@ -5,7 +5,7 @@ def capacitor_pods
5
5
  use_frameworks!
6
6
  pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
7
7
  pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
8
- pod 'BRLMPrinterKit_v4'
8
+ pod 'BRLMPrinterKit_v4', :git => 'https://github.com/rdlabo/BRLMPrinterKit.git', :branch => 'feat/update_4_9_1'
9
9
  end
10
10
 
11
11
  target 'Plugin' do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/capacitor-brotherprint",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "Capacitor plugin for Brother Print SDK",
5
5
  "main": "dist/plugin.js",
6
6
  "module": "dist/esm/index.js",