@capgo/capacitor-ibeacon 7.0.0
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/CapgoCapacitorIbeacon.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +28 -0
- package/README.md +379 -0
- package/android/build.gradle +59 -0
- package/android/src/main/java/ee/forgr/plugin/capacitor_ibeacon/CapacitorIbeaconPlugin.java +171 -0
- package/dist/docs.json +542 -0
- package/dist/esm/definitions.d.ts +352 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +31 -0
- package/dist/esm/web.js +49 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +63 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +66 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/CapacitorIbeaconPlugin/CapacitorIbeacon.swift +234 -0
- package/ios/Sources/CapacitorIbeaconPlugin/CapacitorIbeaconPlugin.swift +159 -0
- package/package.json +92 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacitor iBeacon Plugin - Proximity detection and beacon region monitoring.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
export interface CapacitorIbeaconPlugin {
|
|
7
|
+
/**
|
|
8
|
+
* Start monitoring for a beacon region. Triggers events when entering/exiting the region.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Region to monitor
|
|
11
|
+
* @returns Promise that resolves when monitoring starts
|
|
12
|
+
* @throws Error if monitoring fails to start
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* await CapacitorIbeacon.startMonitoringForRegion({
|
|
17
|
+
* identifier: 'MyBeaconRegion',
|
|
18
|
+
* uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
startMonitoringForRegion(options: BeaconRegion): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Stop monitoring for a beacon region.
|
|
25
|
+
*
|
|
26
|
+
* @param options - Region to stop monitoring
|
|
27
|
+
* @returns Promise that resolves when monitoring stops
|
|
28
|
+
* @throws Error if stopping monitoring fails
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* await CapacitorIbeacon.stopMonitoringForRegion({
|
|
33
|
+
* identifier: 'MyBeaconRegion',
|
|
34
|
+
* uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
stopMonitoringForRegion(options: BeaconRegion): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Start ranging beacons in a region. Provides continuous distance updates.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Region to range beacons in
|
|
43
|
+
* @returns Promise that resolves when ranging starts
|
|
44
|
+
* @throws Error if ranging fails to start
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* await CapacitorIbeacon.startRangingBeaconsInRegion({
|
|
49
|
+
* identifier: 'MyBeaconRegion',
|
|
50
|
+
* uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
startRangingBeaconsInRegion(options: BeaconRegion): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Stop ranging beacons in a region.
|
|
57
|
+
*
|
|
58
|
+
* @param options - Region to stop ranging beacons in
|
|
59
|
+
* @returns Promise that resolves when ranging stops
|
|
60
|
+
* @throws Error if stopping ranging fails
|
|
61
|
+
* @since 1.0.0
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* await CapacitorIbeacon.stopRangingBeaconsInRegion({
|
|
65
|
+
* identifier: 'MyBeaconRegion',
|
|
66
|
+
* uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
stopRangingBeaconsInRegion(options: BeaconRegion): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Start advertising the device as an iBeacon (iOS only).
|
|
73
|
+
*
|
|
74
|
+
* @param options - Beacon advertising parameters
|
|
75
|
+
* @returns Promise that resolves when advertising starts
|
|
76
|
+
* @throws Error if advertising fails to start or on Android
|
|
77
|
+
* @since 1.0.0
|
|
78
|
+
* @platform iOS
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* await CapacitorIbeacon.startAdvertising({
|
|
82
|
+
* uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D',
|
|
83
|
+
* major: 1,
|
|
84
|
+
* minor: 2,
|
|
85
|
+
* identifier: 'MyBeacon'
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
startAdvertising(options: BeaconAdvertisingOptions): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Stop advertising the device as an iBeacon (iOS only).
|
|
92
|
+
*
|
|
93
|
+
* @returns Promise that resolves when advertising stops
|
|
94
|
+
* @throws Error if stopping advertising fails
|
|
95
|
+
* @since 1.0.0
|
|
96
|
+
* @platform iOS
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* await CapacitorIbeacon.stopAdvertising();
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
stopAdvertising(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Request "When In Use" location authorization (required for ranging/monitoring).
|
|
105
|
+
*
|
|
106
|
+
* @returns Promise that resolves with authorization status
|
|
107
|
+
* @throws Error if request fails
|
|
108
|
+
* @since 1.0.0
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const { status } = await CapacitorIbeacon.requestWhenInUseAuthorization();
|
|
112
|
+
* console.log('Authorization status:', status);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
requestWhenInUseAuthorization(): Promise<{
|
|
116
|
+
status: string;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Request "Always" location authorization (required for background monitoring).
|
|
120
|
+
*
|
|
121
|
+
* @returns Promise that resolves with authorization status
|
|
122
|
+
* @throws Error if request fails
|
|
123
|
+
* @since 1.0.0
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const { status } = await CapacitorIbeacon.requestAlwaysAuthorization();
|
|
127
|
+
* console.log('Authorization status:', status);
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
requestAlwaysAuthorization(): Promise<{
|
|
131
|
+
status: string;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* Get current location authorization status.
|
|
135
|
+
*
|
|
136
|
+
* @returns Promise that resolves with authorization status
|
|
137
|
+
* @throws Error if getting status fails
|
|
138
|
+
* @since 1.0.0
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const { status } = await CapacitorIbeacon.getAuthorizationStatus();
|
|
142
|
+
* console.log('Current status:', status);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
getAuthorizationStatus(): Promise<{
|
|
146
|
+
status: string;
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* Check if Bluetooth is enabled on the device.
|
|
150
|
+
*
|
|
151
|
+
* @returns Promise that resolves with Bluetooth state
|
|
152
|
+
* @throws Error if checking state fails
|
|
153
|
+
* @since 1.0.0
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const { enabled } = await CapacitorIbeacon.isBluetoothEnabled();
|
|
157
|
+
* if (!enabled) {
|
|
158
|
+
* console.log('Please enable Bluetooth');
|
|
159
|
+
* }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
isBluetoothEnabled(): Promise<{
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
}>;
|
|
165
|
+
/**
|
|
166
|
+
* Check if ranging is available on the device.
|
|
167
|
+
*
|
|
168
|
+
* @returns Promise that resolves with availability status
|
|
169
|
+
* @throws Error if checking availability fails
|
|
170
|
+
* @since 1.0.0
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const { available } = await CapacitorIbeacon.isRangingAvailable();
|
|
174
|
+
* if (available) {
|
|
175
|
+
* console.log('Ranging is supported');
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
isRangingAvailable(): Promise<{
|
|
180
|
+
available: boolean;
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* Enable ARMA filtering for distance calculations (Android only).
|
|
184
|
+
*
|
|
185
|
+
* @param options - ARMA filter configuration
|
|
186
|
+
* @returns Promise that resolves when filter is configured
|
|
187
|
+
* @throws Error if configuration fails
|
|
188
|
+
* @since 1.0.0
|
|
189
|
+
* @platform Android
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* await CapacitorIbeacon.enableARMAFilter({
|
|
193
|
+
* enabled: true
|
|
194
|
+
* });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
enableARMAFilter(options: {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
}): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Get the native Capacitor plugin version.
|
|
202
|
+
*
|
|
203
|
+
* @returns Promise that resolves with the plugin version
|
|
204
|
+
* @throws Error if getting the version fails
|
|
205
|
+
* @since 1.0.0
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const { version } = await CapacitorIbeacon.getPluginVersion();
|
|
209
|
+
* console.log('Plugin version:', version);
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
getPluginVersion(): Promise<{
|
|
213
|
+
version: string;
|
|
214
|
+
}>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Beacon region definition for monitoring and ranging.
|
|
218
|
+
*/
|
|
219
|
+
export interface BeaconRegion {
|
|
220
|
+
/**
|
|
221
|
+
* Unique identifier for this region.
|
|
222
|
+
*/
|
|
223
|
+
identifier: string;
|
|
224
|
+
/**
|
|
225
|
+
* UUID of the beacon(s) to detect.
|
|
226
|
+
*/
|
|
227
|
+
uuid: string;
|
|
228
|
+
/**
|
|
229
|
+
* Major value for filtering (optional).
|
|
230
|
+
*/
|
|
231
|
+
major?: number;
|
|
232
|
+
/**
|
|
233
|
+
* Minor value for filtering (optional).
|
|
234
|
+
*/
|
|
235
|
+
minor?: number;
|
|
236
|
+
/**
|
|
237
|
+
* Notify when device enters region (iOS only).
|
|
238
|
+
*/
|
|
239
|
+
notifyEntryStateOnDisplay?: boolean;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Beacon advertising options for transmitting as an iBeacon (iOS only).
|
|
243
|
+
*/
|
|
244
|
+
export interface BeaconAdvertisingOptions {
|
|
245
|
+
/**
|
|
246
|
+
* UUID to advertise.
|
|
247
|
+
*/
|
|
248
|
+
uuid: string;
|
|
249
|
+
/**
|
|
250
|
+
* Major value (0-65535).
|
|
251
|
+
*/
|
|
252
|
+
major: number;
|
|
253
|
+
/**
|
|
254
|
+
* Minor value (0-65535).
|
|
255
|
+
*/
|
|
256
|
+
minor: number;
|
|
257
|
+
/**
|
|
258
|
+
* Identifier for the advertising beacon.
|
|
259
|
+
*/
|
|
260
|
+
identifier: string;
|
|
261
|
+
/**
|
|
262
|
+
* Measured power (RSSI at 1 meter). Optional, defaults to -59.
|
|
263
|
+
*/
|
|
264
|
+
measuredPower?: number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Detected beacon information.
|
|
268
|
+
*/
|
|
269
|
+
export interface Beacon {
|
|
270
|
+
/**
|
|
271
|
+
* Beacon UUID.
|
|
272
|
+
*/
|
|
273
|
+
uuid: string;
|
|
274
|
+
/**
|
|
275
|
+
* Major value.
|
|
276
|
+
*/
|
|
277
|
+
major: number;
|
|
278
|
+
/**
|
|
279
|
+
* Minor value.
|
|
280
|
+
*/
|
|
281
|
+
minor: number;
|
|
282
|
+
/**
|
|
283
|
+
* RSSI (Received Signal Strength Indicator).
|
|
284
|
+
*/
|
|
285
|
+
rssi: number;
|
|
286
|
+
/**
|
|
287
|
+
* Proximity: 'immediate', 'near', 'far', or 'unknown'.
|
|
288
|
+
*/
|
|
289
|
+
proximity: 'immediate' | 'near' | 'far' | 'unknown';
|
|
290
|
+
/**
|
|
291
|
+
* Estimated distance in meters.
|
|
292
|
+
*/
|
|
293
|
+
accuracy: number;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Event data when beacons are ranged.
|
|
297
|
+
*/
|
|
298
|
+
export interface RangingEventData {
|
|
299
|
+
/**
|
|
300
|
+
* Region that was ranged.
|
|
301
|
+
*/
|
|
302
|
+
region: BeaconRegion;
|
|
303
|
+
/**
|
|
304
|
+
* Array of detected beacons.
|
|
305
|
+
*/
|
|
306
|
+
beacons: Beacon[];
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Event data when entering or exiting a region.
|
|
310
|
+
*/
|
|
311
|
+
export interface MonitoringEventData {
|
|
312
|
+
/**
|
|
313
|
+
* Region that triggered the event.
|
|
314
|
+
*/
|
|
315
|
+
region: BeaconRegion;
|
|
316
|
+
/**
|
|
317
|
+
* Event state: 'enter' or 'exit'.
|
|
318
|
+
*/
|
|
319
|
+
state: 'enter' | 'exit';
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Event listeners for iBeacon plugin.
|
|
323
|
+
*/
|
|
324
|
+
export interface BeaconEventListeners {
|
|
325
|
+
/**
|
|
326
|
+
* Called when beacons are detected during ranging.
|
|
327
|
+
*/
|
|
328
|
+
didRangeBeacons?: (data: RangingEventData) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Called when entering or exiting a monitored region.
|
|
331
|
+
*/
|
|
332
|
+
didDetermineStateForRegion?: (data: MonitoringEventData) => void;
|
|
333
|
+
/**
|
|
334
|
+
* Called when entering a monitored region.
|
|
335
|
+
*/
|
|
336
|
+
didEnterRegion?: (data: {
|
|
337
|
+
region: BeaconRegion;
|
|
338
|
+
}) => void;
|
|
339
|
+
/**
|
|
340
|
+
* Called when exiting a monitored region.
|
|
341
|
+
*/
|
|
342
|
+
didExitRegion?: (data: {
|
|
343
|
+
region: BeaconRegion;
|
|
344
|
+
}) => void;
|
|
345
|
+
/**
|
|
346
|
+
* Called when monitoring state changes.
|
|
347
|
+
*/
|
|
348
|
+
monitoringDidFailForRegion?: (data: {
|
|
349
|
+
region: BeaconRegion;
|
|
350
|
+
error: string;
|
|
351
|
+
}) => void;
|
|
352
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const CapacitorIbeacon = registerPlugin('CapacitorIbeacon', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.CapacitorIbeaconWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { CapacitorIbeacon };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,gBAAgB,GAAG,cAAc,CAAyB,kBAAkB,EAAE;IAClF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;CACpE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { CapacitorIbeaconPlugin, BeaconRegion, BeaconAdvertisingOptions } from './definitions';
|
|
3
|
+
export declare class CapacitorIbeaconWeb extends WebPlugin implements CapacitorIbeaconPlugin {
|
|
4
|
+
startMonitoringForRegion(_options: BeaconRegion): Promise<void>;
|
|
5
|
+
stopMonitoringForRegion(_options: BeaconRegion): Promise<void>;
|
|
6
|
+
startRangingBeaconsInRegion(_options: BeaconRegion): Promise<void>;
|
|
7
|
+
stopRangingBeaconsInRegion(_options: BeaconRegion): Promise<void>;
|
|
8
|
+
startAdvertising(_options: BeaconAdvertisingOptions): Promise<void>;
|
|
9
|
+
stopAdvertising(): Promise<void>;
|
|
10
|
+
requestWhenInUseAuthorization(): Promise<{
|
|
11
|
+
status: string;
|
|
12
|
+
}>;
|
|
13
|
+
requestAlwaysAuthorization(): Promise<{
|
|
14
|
+
status: string;
|
|
15
|
+
}>;
|
|
16
|
+
getAuthorizationStatus(): Promise<{
|
|
17
|
+
status: string;
|
|
18
|
+
}>;
|
|
19
|
+
isBluetoothEnabled(): Promise<{
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
isRangingAvailable(): Promise<{
|
|
23
|
+
available: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
enableARMAFilter(_options: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
getPluginVersion(): Promise<{
|
|
29
|
+
version: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class CapacitorIbeaconWeb extends WebPlugin {
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
startMonitoringForRegion(_options) {
|
|
5
|
+
throw new Error('Method not implemented on web platform.');
|
|
6
|
+
}
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
stopMonitoringForRegion(_options) {
|
|
9
|
+
throw new Error('Method not implemented on web platform.');
|
|
10
|
+
}
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
startRangingBeaconsInRegion(_options) {
|
|
13
|
+
throw new Error('Method not implemented on web platform.');
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
stopRangingBeaconsInRegion(_options) {
|
|
17
|
+
throw new Error('Method not implemented on web platform.');
|
|
18
|
+
}
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
startAdvertising(_options) {
|
|
21
|
+
throw new Error('Method not implemented on web platform.');
|
|
22
|
+
}
|
|
23
|
+
stopAdvertising() {
|
|
24
|
+
throw new Error('Method not implemented on web platform.');
|
|
25
|
+
}
|
|
26
|
+
requestWhenInUseAuthorization() {
|
|
27
|
+
return Promise.resolve({ status: 'denied' });
|
|
28
|
+
}
|
|
29
|
+
requestAlwaysAuthorization() {
|
|
30
|
+
return Promise.resolve({ status: 'denied' });
|
|
31
|
+
}
|
|
32
|
+
getAuthorizationStatus() {
|
|
33
|
+
return Promise.resolve({ status: 'not_determined' });
|
|
34
|
+
}
|
|
35
|
+
isBluetoothEnabled() {
|
|
36
|
+
return Promise.resolve({ enabled: false });
|
|
37
|
+
}
|
|
38
|
+
isRangingAvailable() {
|
|
39
|
+
return Promise.resolve({ available: false });
|
|
40
|
+
}
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
+
enableARMAFilter(_options) {
|
|
43
|
+
throw new Error('Method not implemented on web platform.');
|
|
44
|
+
}
|
|
45
|
+
async getPluginVersion() {
|
|
46
|
+
return { version: 'web' };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAChD,6DAA6D;IAC7D,wBAAwB,CAAC,QAAsB;QAC7C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,6DAA6D;IAC7D,uBAAuB,CAAC,QAAsB;QAC5C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,6DAA6D;IAC7D,2BAA2B,CAAC,QAAsB;QAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,6DAA6D;IAC7D,0BAA0B,CAAC,QAAsB;QAC/C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,6DAA6D;IAC7D,gBAAgB,CAAC,QAAkC;QACjD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,eAAe;QACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,6BAA6B;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,0BAA0B;QACxB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,sBAAsB;QACpB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,kBAAkB;QAChB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,kBAAkB;QAChB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,6DAA6D;IAC7D,gBAAgB,CAAC,QAA8B;QAC7C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
const CapacitorIbeacon = core.registerPlugin('CapacitorIbeacon', {
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorIbeaconWeb()),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
class CapacitorIbeaconWeb extends core.WebPlugin {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
startMonitoringForRegion(_options) {
|
|
12
|
+
throw new Error('Method not implemented on web platform.');
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
stopMonitoringForRegion(_options) {
|
|
16
|
+
throw new Error('Method not implemented on web platform.');
|
|
17
|
+
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
startRangingBeaconsInRegion(_options) {
|
|
20
|
+
throw new Error('Method not implemented on web platform.');
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
+
stopRangingBeaconsInRegion(_options) {
|
|
24
|
+
throw new Error('Method not implemented on web platform.');
|
|
25
|
+
}
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
startAdvertising(_options) {
|
|
28
|
+
throw new Error('Method not implemented on web platform.');
|
|
29
|
+
}
|
|
30
|
+
stopAdvertising() {
|
|
31
|
+
throw new Error('Method not implemented on web platform.');
|
|
32
|
+
}
|
|
33
|
+
requestWhenInUseAuthorization() {
|
|
34
|
+
return Promise.resolve({ status: 'denied' });
|
|
35
|
+
}
|
|
36
|
+
requestAlwaysAuthorization() {
|
|
37
|
+
return Promise.resolve({ status: 'denied' });
|
|
38
|
+
}
|
|
39
|
+
getAuthorizationStatus() {
|
|
40
|
+
return Promise.resolve({ status: 'not_determined' });
|
|
41
|
+
}
|
|
42
|
+
isBluetoothEnabled() {
|
|
43
|
+
return Promise.resolve({ enabled: false });
|
|
44
|
+
}
|
|
45
|
+
isRangingAvailable() {
|
|
46
|
+
return Promise.resolve({ available: false });
|
|
47
|
+
}
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
+
enableARMAFilter(_options) {
|
|
50
|
+
throw new Error('Method not implemented on web platform.');
|
|
51
|
+
}
|
|
52
|
+
async getPluginVersion() {
|
|
53
|
+
return { version: 'web' };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
58
|
+
__proto__: null,
|
|
59
|
+
CapacitorIbeaconWeb: CapacitorIbeaconWeb
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
exports.CapacitorIbeacon = CapacitorIbeacon;
|
|
63
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorIbeacon = registerPlugin('CapacitorIbeacon', {\n web: () => import('./web').then((m) => new m.CapacitorIbeaconWeb()),\n});\nexport * from './definitions';\nexport { CapacitorIbeacon };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorIbeaconWeb extends WebPlugin {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startMonitoringForRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n stopMonitoringForRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startRangingBeaconsInRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n stopRangingBeaconsInRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startAdvertising(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n stopAdvertising() {\n throw new Error('Method not implemented on web platform.');\n }\n requestWhenInUseAuthorization() {\n return Promise.resolve({ status: 'denied' });\n }\n requestAlwaysAuthorization() {\n return Promise.resolve({ status: 'denied' });\n }\n getAuthorizationStatus() {\n return Promise.resolve({ status: 'not_determined' });\n }\n isBluetoothEnabled() {\n return Promise.resolve({ enabled: false });\n }\n isRangingAvailable() {\n return Promise.resolve({ available: false });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n enableARMAFilter(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;AAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACvE,CAAC;;ACFM,MAAM,mBAAmB,SAASC,cAAS,CAAC;AACnD;AACA,IAAI,wBAAwB,CAAC,QAAQ,EAAE;AACvC,QAAQ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MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;AAClE,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var capacitorCapacitorIbeacon = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const CapacitorIbeacon = core.registerPlugin('CapacitorIbeacon', {
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorIbeaconWeb()),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
class CapacitorIbeaconWeb extends core.WebPlugin {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
startMonitoringForRegion(_options) {
|
|
11
|
+
throw new Error('Method not implemented on web platform.');
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
stopMonitoringForRegion(_options) {
|
|
15
|
+
throw new Error('Method not implemented on web platform.');
|
|
16
|
+
}
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
startRangingBeaconsInRegion(_options) {
|
|
19
|
+
throw new Error('Method not implemented on web platform.');
|
|
20
|
+
}
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
stopRangingBeaconsInRegion(_options) {
|
|
23
|
+
throw new Error('Method not implemented on web platform.');
|
|
24
|
+
}
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
|
+
startAdvertising(_options) {
|
|
27
|
+
throw new Error('Method not implemented on web platform.');
|
|
28
|
+
}
|
|
29
|
+
stopAdvertising() {
|
|
30
|
+
throw new Error('Method not implemented on web platform.');
|
|
31
|
+
}
|
|
32
|
+
requestWhenInUseAuthorization() {
|
|
33
|
+
return Promise.resolve({ status: 'denied' });
|
|
34
|
+
}
|
|
35
|
+
requestAlwaysAuthorization() {
|
|
36
|
+
return Promise.resolve({ status: 'denied' });
|
|
37
|
+
}
|
|
38
|
+
getAuthorizationStatus() {
|
|
39
|
+
return Promise.resolve({ status: 'not_determined' });
|
|
40
|
+
}
|
|
41
|
+
isBluetoothEnabled() {
|
|
42
|
+
return Promise.resolve({ enabled: false });
|
|
43
|
+
}
|
|
44
|
+
isRangingAvailable() {
|
|
45
|
+
return Promise.resolve({ available: false });
|
|
46
|
+
}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
|
+
enableARMAFilter(_options) {
|
|
49
|
+
throw new Error('Method not implemented on web platform.');
|
|
50
|
+
}
|
|
51
|
+
async getPluginVersion() {
|
|
52
|
+
return { version: 'web' };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
57
|
+
__proto__: null,
|
|
58
|
+
CapacitorIbeaconWeb: CapacitorIbeaconWeb
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
exports.CapacitorIbeacon = CapacitorIbeacon;
|
|
62
|
+
|
|
63
|
+
return exports;
|
|
64
|
+
|
|
65
|
+
})({}, capacitorExports);
|
|
66
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorIbeacon = registerPlugin('CapacitorIbeacon', {\n web: () => import('./web').then((m) => new m.CapacitorIbeaconWeb()),\n});\nexport * from './definitions';\nexport { CapacitorIbeacon };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorIbeaconWeb extends WebPlugin {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startMonitoringForRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n stopMonitoringForRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startRangingBeaconsInRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n stopRangingBeaconsInRegion(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startAdvertising(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n stopAdvertising() {\n throw new Error('Method not implemented on web platform.');\n }\n requestWhenInUseAuthorization() {\n return Promise.resolve({ status: 'denied' });\n }\n requestAlwaysAuthorization() {\n return Promise.resolve({ status: 'denied' });\n }\n getAuthorizationStatus() {\n return Promise.resolve({ status: 'not_determined' });\n }\n isBluetoothEnabled() {\n return Promise.resolve({ enabled: false });\n }\n isRangingAvailable() {\n return Promise.resolve({ available: false });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n enableARMAFilter(_options) {\n throw new Error('Method not implemented on web platform.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IACvE,CAAC;;ICFM,MAAM,mBAAmB,SAASC,cAAS,CAAC;IACnD;IACA,IAAI,wBAAwB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;IAClE,IAAI;IACJ;IACA,IAAI,uBAAuB,CAAC,QAAQ,EAAE;IACtC,QAAQ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;IAClE,IAAI;IACJ;IACA,IAAI,2BAA2B,CAAC,QAAQ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