@simplysm/capacitor-plugin-broadcast 12.16.24 → 12.16.29

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 (2) hide show
  1. package/package.json +2 -2
  2. package/README.md +0 -112
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/capacitor-plugin-broadcast",
3
- "version": "12.16.24",
3
+ "version": "12.16.29",
4
4
  "description": "심플리즘 패키지 - Capacitor Broadcast Plugin",
5
5
  "author": "김석래",
6
6
  "repository": {
@@ -21,6 +21,6 @@
21
21
  "@capacitor/core": "^7.4.4"
22
22
  },
23
23
  "devDependencies": {
24
- "@capacitor/core": "^7.4.4"
24
+ "@capacitor/core": "^7.5.0"
25
25
  }
26
26
  }
package/README.md DELETED
@@ -1,112 +0,0 @@
1
- # @simplysm/capacitor-plugin-broadcast
2
-
3
- Android Broadcast 송수신을 위한 Capacitor 플러그인입니다.
4
-
5
- 산업용 장치(바코드 스캐너, PDA 등)와의 연동을 위해 설계되었습니다.
6
-
7
- > ⚠️ **Android 전용** - iOS는 Broadcast 개념이 없어 지원하지 않습니다.
8
-
9
- ## 설치
10
-
11
- ```bash
12
- yarn add @simplysm/capacitor-plugin-broadcast
13
- npx cap sync
14
- ```
15
-
16
- ## 사용법
17
-
18
- ### Broadcast 수신
19
-
20
- ```typescript
21
- import { Broadcast } from "@simplysm/capacitor-plugin-broadcast";
22
-
23
- // 수신 등록 - 해제 함수 반환
24
- const unsubscribe = await Broadcast.subscribe(
25
- ["com.symbol.datawedge.api.RESULT_ACTION"],
26
- (result) => {
27
- console.log("Action:", result.action);
28
- console.log("Extras:", result.extras);
29
- }
30
- );
31
-
32
- // 수신 해제
33
- await unsubscribe();
34
- ```
35
-
36
- ### Broadcast 송신
37
-
38
- ```typescript
39
- import { Broadcast } from "@simplysm/capacitor-plugin-broadcast";
40
-
41
- await Broadcast.send({
42
- action: "com.symbol.datawedge.api.ACTION",
43
- extras: {
44
- "com.symbol.datawedge.api.SOFT_SCAN_TRIGGER": "TOGGLE_SCANNING"
45
- }
46
- });
47
- ```
48
-
49
- ### 전체 수신기 해제
50
-
51
- ```typescript
52
- import { Broadcast } from "@simplysm/capacitor-plugin-broadcast";
53
-
54
- await Broadcast.unsubscribeAll();
55
- ```
56
-
57
- ### 앱 시작 Intent 가져오기
58
-
59
- ```typescript
60
- import { Broadcast } from "@simplysm/capacitor-plugin-broadcast";
61
-
62
- const launchIntent = await Broadcast.getLaunchIntent();
63
- console.log(launchIntent.action);
64
- console.log(launchIntent.extras);
65
- ```
66
-
67
- ## API
68
-
69
- | 메서드 | 설명 |
70
- |--------|------|
71
- | `subscribe(filters, callback)` | Broadcast 수신 등록, 해제 함수 반환 |
72
- | `unsubscribeAll()` | 모든 수신기 해제 |
73
- | `send({ action, extras })` | Broadcast 송신 |
74
- | `getLaunchIntent()` | 앱 시작 Intent 가져오기 |
75
-
76
- ## 예제: Zebra DataWedge 연동
77
-
78
- ```typescript
79
- import { Broadcast } from "@simplysm/capacitor-plugin-broadcast";
80
-
81
- // 바코드 스캔 결과 수신
82
- const unsubscribe = await Broadcast.subscribe(
83
- ["com.symbol.datawedge.api.RESULT_ACTION"],
84
- (result) => {
85
- const barcode = result.extras?.["com.symbol.datawedge.data_string"];
86
- if (barcode) {
87
- console.log("스캔된 바코드:", barcode);
88
- }
89
- }
90
- );
91
-
92
- // 소프트 스캔 트리거
93
- await Broadcast.send({
94
- action: "com.symbol.datawedge.api.ACTION",
95
- extras: {
96
- "com.symbol.datawedge.api.SOFT_SCAN_TRIGGER": "TOGGLE_SCANNING"
97
- }
98
- });
99
- ```
100
-
101
- ## 타입 정의
102
-
103
- ```typescript
104
- interface IBroadcastResult {
105
- action?: string;
106
- extras?: Record<string, unknown>;
107
- }
108
- ```
109
-
110
- ## 라이선스
111
-
112
- MIT