@capgo/capacitor-wifi 8.1.2 → 8.1.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.
- package/README.md +33 -0
- package/android/src/main/java/ee/forgr/plugin/capacitor_wifi/CapacitorWifiPlugin.java +86 -1
- package/dist/docs.json +115 -0
- package/dist/esm/definitions.d.ts +69 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorWifiPlugin/CapacitorWifiPlugin.swift +54 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ npx cap sync
|
|
|
47
47
|
* [`getIpAddress()`](#getipaddress)
|
|
48
48
|
* [`getRssi()`](#getrssi)
|
|
49
49
|
* [`getSsid()`](#getssid)
|
|
50
|
+
* [`getWifiInfo()`](#getwifiinfo)
|
|
50
51
|
* [`isEnabled()`](#isenabled)
|
|
51
52
|
* [`startScan()`](#startscan)
|
|
52
53
|
* [`checkPermissions()`](#checkpermissions)
|
|
@@ -187,6 +188,24 @@ Available on both Android and iOS.
|
|
|
187
188
|
--------------------
|
|
188
189
|
|
|
189
190
|
|
|
191
|
+
### getWifiInfo()
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
getWifiInfo() => Promise<WifiInfo>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Get comprehensive information about the currently connected WiFi network.
|
|
198
|
+
This method provides detailed network information including SSID, BSSID, IP address,
|
|
199
|
+
frequency, link speed, and signal strength in a single call.
|
|
200
|
+
On iOS, some fields may not be available and will be undefined.
|
|
201
|
+
|
|
202
|
+
**Returns:** <code>Promise<<a href="#wifiinfo">WifiInfo</a>></code>
|
|
203
|
+
|
|
204
|
+
**Since:** 7.0.0
|
|
205
|
+
|
|
206
|
+
--------------------
|
|
207
|
+
|
|
208
|
+
|
|
190
209
|
### isEnabled()
|
|
191
210
|
|
|
192
211
|
```typescript
|
|
@@ -388,6 +407,20 @@ Result from getSsid()
|
|
|
388
407
|
| **`ssid`** | <code>string</code> | The SSID of the current network | 7.0.0 |
|
|
389
408
|
|
|
390
409
|
|
|
410
|
+
#### WifiInfo
|
|
411
|
+
|
|
412
|
+
Comprehensive WiFi information
|
|
413
|
+
|
|
414
|
+
| Prop | Type | Description | Since |
|
|
415
|
+
| -------------------- | ------------------- | ----------------------------------------------------------------------------------- | ----- |
|
|
416
|
+
| **`ssid`** | <code>string</code> | The SSID (network name) of the current network | 7.0.0 |
|
|
417
|
+
| **`bssid`** | <code>string</code> | The BSSID (MAC address) of the access point. Not available on iOS. | 7.0.0 |
|
|
418
|
+
| **`ip`** | <code>string</code> | The device's IP address on the network | 7.0.0 |
|
|
419
|
+
| **`frequency`** | <code>number</code> | The network frequency in MHz. Not available on iOS. | 7.0.0 |
|
|
420
|
+
| **`linkSpeed`** | <code>number</code> | The connection speed in Mbps. Not available on iOS. | 7.0.0 |
|
|
421
|
+
| **`signalStrength`** | <code>number</code> | The signal strength (0-100). Calculated from RSSI on Android. Not available on iOS. | 7.0.0 |
|
|
422
|
+
|
|
423
|
+
|
|
391
424
|
#### IsEnabledResult
|
|
392
425
|
|
|
393
426
|
Result from isEnabled()
|
|
@@ -44,7 +44,7 @@ import java.util.List;
|
|
|
44
44
|
)
|
|
45
45
|
public class CapacitorWifiPlugin extends Plugin {
|
|
46
46
|
|
|
47
|
-
private final String pluginVersion = "8.1.
|
|
47
|
+
private final String pluginVersion = "8.1.3";
|
|
48
48
|
|
|
49
49
|
private WifiManager wifiManager;
|
|
50
50
|
private ConnectivityManager connectivityManager;
|
|
@@ -517,6 +517,82 @@ public class CapacitorWifiPlugin extends Plugin {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
@PluginMethod
|
|
521
|
+
public void getWifiInfo(PluginCall call) {
|
|
522
|
+
if (getPermissionState("location") != PermissionState.GRANTED) {
|
|
523
|
+
requestPermissionForAlias("location", call, "getWifiInfoCallback");
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
try {
|
|
528
|
+
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
|
529
|
+
if (wifiInfo == null) {
|
|
530
|
+
call.reject("Failed to get WiFi info");
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
JSObject ret = new JSObject();
|
|
535
|
+
|
|
536
|
+
// Get SSID
|
|
537
|
+
String ssid = wifiInfo.getSSID();
|
|
538
|
+
if (ssid != null) {
|
|
539
|
+
ssid = ssid.replace("\"", "");
|
|
540
|
+
ret.put("ssid", ssid);
|
|
541
|
+
} else {
|
|
542
|
+
call.reject("No SSID found");
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Get BSSID (MAC address of access point)
|
|
547
|
+
String bssid = wifiInfo.getBSSID();
|
|
548
|
+
if (bssid != null) {
|
|
549
|
+
ret.put("bssid", bssid);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// Get IP Address
|
|
553
|
+
String ipAddress = getWifiIpAddress();
|
|
554
|
+
if (ipAddress != null && !ipAddress.isEmpty()) {
|
|
555
|
+
ret.put("ip", ipAddress);
|
|
556
|
+
} else {
|
|
557
|
+
call.reject("No IP address found");
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// Get Frequency (API 21+)
|
|
562
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
563
|
+
int frequency = wifiInfo.getFrequency();
|
|
564
|
+
ret.put("frequency", frequency);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// Get Link Speed
|
|
568
|
+
int linkSpeed = wifiInfo.getLinkSpeed();
|
|
569
|
+
ret.put("linkSpeed", linkSpeed);
|
|
570
|
+
|
|
571
|
+
// Get Signal Strength (0-100)
|
|
572
|
+
int rssi = wifiInfo.getRssi();
|
|
573
|
+
int signalStrength = calculateSignalStrength(rssi);
|
|
574
|
+
ret.put("signalStrength", signalStrength);
|
|
575
|
+
|
|
576
|
+
call.resolve(ret);
|
|
577
|
+
} catch (Exception e) {
|
|
578
|
+
call.reject("Failed to get WiFi info: " + e.getMessage(), e);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Calculate signal strength percentage (0-100) from RSSI
|
|
584
|
+
* RSSI typically ranges from -100 (weak) to -50 (strong)
|
|
585
|
+
*/
|
|
586
|
+
private int calculateSignalStrength(int rssi) {
|
|
587
|
+
if (rssi <= -100) {
|
|
588
|
+
return 0;
|
|
589
|
+
} else if (rssi >= -50) {
|
|
590
|
+
return 100;
|
|
591
|
+
} else {
|
|
592
|
+
return 2 * (rssi + 100);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
520
596
|
@PluginMethod
|
|
521
597
|
public void isEnabled(PluginCall call) {
|
|
522
598
|
try {
|
|
@@ -621,6 +697,15 @@ public class CapacitorWifiPlugin extends Plugin {
|
|
|
621
697
|
}
|
|
622
698
|
}
|
|
623
699
|
|
|
700
|
+
@PermissionCallback
|
|
701
|
+
private void getWifiInfoCallback(PluginCall call) {
|
|
702
|
+
if (getPermissionState("location") == PermissionState.GRANTED) {
|
|
703
|
+
getWifiInfo(call);
|
|
704
|
+
} else {
|
|
705
|
+
call.reject("Location permission is required");
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
624
709
|
@PermissionCallback
|
|
625
710
|
private void startScanCallback(PluginCall call) {
|
|
626
711
|
if (getPermissionState("location") == PermissionState.GRANTED) {
|
package/dist/docs.json
CHANGED
|
@@ -243,6 +243,35 @@
|
|
|
243
243
|
],
|
|
244
244
|
"slug": "getssid"
|
|
245
245
|
},
|
|
246
|
+
{
|
|
247
|
+
"name": "getWifiInfo",
|
|
248
|
+
"signature": "() => Promise<WifiInfo>",
|
|
249
|
+
"parameters": [],
|
|
250
|
+
"returns": "Promise<WifiInfo>",
|
|
251
|
+
"tags": [
|
|
252
|
+
{
|
|
253
|
+
"name": "returns",
|
|
254
|
+
"text": "Promise that resolves with the WiFi information"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "throws",
|
|
258
|
+
"text": "Error if getting WiFi info fails"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "since",
|
|
262
|
+
"text": "7.0.0"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "example",
|
|
266
|
+
"text": "```typescript\nconst info = await CapacitorWifi.getWifiInfo();\nconsole.log('Network:', info.ssid);\nconsole.log('BSSID:', info.bssid);\nconsole.log('IP:', info.ip);\nconsole.log('Frequency:', info.frequency, 'MHz');\nconsole.log('Speed:', info.linkSpeed, 'Mbps');\nconsole.log('Signal:', info.signalStrength);\n```"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"docs": "Get comprehensive information about the currently connected WiFi network.\nThis method provides detailed network information including SSID, BSSID, IP address,\nfrequency, link speed, and signal strength in a single call.\nOn iOS, some fields may not be available and will be undefined.",
|
|
270
|
+
"complexTypes": [
|
|
271
|
+
"WifiInfo"
|
|
272
|
+
],
|
|
273
|
+
"slug": "getwifiinfo"
|
|
274
|
+
},
|
|
246
275
|
{
|
|
247
276
|
"name": "isEnabled",
|
|
248
277
|
"signature": "() => Promise<IsEnabledResult>",
|
|
@@ -792,6 +821,92 @@
|
|
|
792
821
|
}
|
|
793
822
|
]
|
|
794
823
|
},
|
|
824
|
+
{
|
|
825
|
+
"name": "WifiInfo",
|
|
826
|
+
"slug": "wifiinfo",
|
|
827
|
+
"docs": "Comprehensive WiFi information",
|
|
828
|
+
"tags": [
|
|
829
|
+
{
|
|
830
|
+
"text": "7.0.0",
|
|
831
|
+
"name": "since"
|
|
832
|
+
}
|
|
833
|
+
],
|
|
834
|
+
"methods": [],
|
|
835
|
+
"properties": [
|
|
836
|
+
{
|
|
837
|
+
"name": "ssid",
|
|
838
|
+
"tags": [
|
|
839
|
+
{
|
|
840
|
+
"text": "7.0.0",
|
|
841
|
+
"name": "since"
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
"docs": "The SSID (network name) of the current network",
|
|
845
|
+
"complexTypes": [],
|
|
846
|
+
"type": "string"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"name": "bssid",
|
|
850
|
+
"tags": [
|
|
851
|
+
{
|
|
852
|
+
"text": "7.0.0",
|
|
853
|
+
"name": "since"
|
|
854
|
+
}
|
|
855
|
+
],
|
|
856
|
+
"docs": "The BSSID (MAC address) of the access point.\nNot available on iOS.",
|
|
857
|
+
"complexTypes": [],
|
|
858
|
+
"type": "string | undefined"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"name": "ip",
|
|
862
|
+
"tags": [
|
|
863
|
+
{
|
|
864
|
+
"text": "7.0.0",
|
|
865
|
+
"name": "since"
|
|
866
|
+
}
|
|
867
|
+
],
|
|
868
|
+
"docs": "The device's IP address on the network",
|
|
869
|
+
"complexTypes": [],
|
|
870
|
+
"type": "string"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"name": "frequency",
|
|
874
|
+
"tags": [
|
|
875
|
+
{
|
|
876
|
+
"text": "7.0.0",
|
|
877
|
+
"name": "since"
|
|
878
|
+
}
|
|
879
|
+
],
|
|
880
|
+
"docs": "The network frequency in MHz.\nNot available on iOS.",
|
|
881
|
+
"complexTypes": [],
|
|
882
|
+
"type": "number | undefined"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"name": "linkSpeed",
|
|
886
|
+
"tags": [
|
|
887
|
+
{
|
|
888
|
+
"text": "7.0.0",
|
|
889
|
+
"name": "since"
|
|
890
|
+
}
|
|
891
|
+
],
|
|
892
|
+
"docs": "The connection speed in Mbps.\nNot available on iOS.",
|
|
893
|
+
"complexTypes": [],
|
|
894
|
+
"type": "number | undefined"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"name": "signalStrength",
|
|
898
|
+
"tags": [
|
|
899
|
+
{
|
|
900
|
+
"text": "7.0.0",
|
|
901
|
+
"name": "since"
|
|
902
|
+
}
|
|
903
|
+
],
|
|
904
|
+
"docs": "The signal strength (0-100).\nCalculated from RSSI on Android.\nNot available on iOS.",
|
|
905
|
+
"complexTypes": [],
|
|
906
|
+
"type": "number | undefined"
|
|
907
|
+
}
|
|
908
|
+
]
|
|
909
|
+
},
|
|
795
910
|
{
|
|
796
911
|
"name": "IsEnabledResult",
|
|
797
912
|
"slug": "isenabledresult",
|
|
@@ -118,6 +118,27 @@ export interface CapacitorWifiPlugin {
|
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
120
|
getSsid(): Promise<GetSsidResult>;
|
|
121
|
+
/**
|
|
122
|
+
* Get comprehensive information about the currently connected WiFi network.
|
|
123
|
+
* This method provides detailed network information including SSID, BSSID, IP address,
|
|
124
|
+
* frequency, link speed, and signal strength in a single call.
|
|
125
|
+
* On iOS, some fields may not be available and will be undefined.
|
|
126
|
+
*
|
|
127
|
+
* @returns Promise that resolves with the WiFi information
|
|
128
|
+
* @throws Error if getting WiFi info fails
|
|
129
|
+
* @since 7.0.0
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const info = await CapacitorWifi.getWifiInfo();
|
|
133
|
+
* console.log('Network:', info.ssid);
|
|
134
|
+
* console.log('BSSID:', info.bssid);
|
|
135
|
+
* console.log('IP:', info.ip);
|
|
136
|
+
* console.log('Frequency:', info.frequency, 'MHz');
|
|
137
|
+
* console.log('Speed:', info.linkSpeed, 'Mbps');
|
|
138
|
+
* console.log('Signal:', info.signalStrength);
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
getWifiInfo(): Promise<WifiInfo>;
|
|
121
142
|
/**
|
|
122
143
|
* Check if Wi-Fi is enabled on the device.
|
|
123
144
|
* Only available on Android.
|
|
@@ -384,6 +405,54 @@ export interface GetSsidResult {
|
|
|
384
405
|
*/
|
|
385
406
|
ssid: string;
|
|
386
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* Comprehensive WiFi information
|
|
410
|
+
*
|
|
411
|
+
* @since 7.0.0
|
|
412
|
+
*/
|
|
413
|
+
export interface WifiInfo {
|
|
414
|
+
/**
|
|
415
|
+
* The SSID (network name) of the current network
|
|
416
|
+
*
|
|
417
|
+
* @since 7.0.0
|
|
418
|
+
*/
|
|
419
|
+
ssid: string;
|
|
420
|
+
/**
|
|
421
|
+
* The BSSID (MAC address) of the access point.
|
|
422
|
+
* Not available on iOS.
|
|
423
|
+
*
|
|
424
|
+
* @since 7.0.0
|
|
425
|
+
*/
|
|
426
|
+
bssid?: string;
|
|
427
|
+
/**
|
|
428
|
+
* The device's IP address on the network
|
|
429
|
+
*
|
|
430
|
+
* @since 7.0.0
|
|
431
|
+
*/
|
|
432
|
+
ip: string;
|
|
433
|
+
/**
|
|
434
|
+
* The network frequency in MHz.
|
|
435
|
+
* Not available on iOS.
|
|
436
|
+
*
|
|
437
|
+
* @since 7.0.0
|
|
438
|
+
*/
|
|
439
|
+
frequency?: number;
|
|
440
|
+
/**
|
|
441
|
+
* The connection speed in Mbps.
|
|
442
|
+
* Not available on iOS.
|
|
443
|
+
*
|
|
444
|
+
* @since 7.0.0
|
|
445
|
+
*/
|
|
446
|
+
linkSpeed?: number;
|
|
447
|
+
/**
|
|
448
|
+
* The signal strength (0-100).
|
|
449
|
+
* Calculated from RSSI on Android.
|
|
450
|
+
* Not available on iOS.
|
|
451
|
+
*
|
|
452
|
+
* @since 7.0.0
|
|
453
|
+
*/
|
|
454
|
+
signalStrength?: number;
|
|
455
|
+
}
|
|
387
456
|
/**
|
|
388
457
|
* Result from isEnabled()
|
|
389
458
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAgdA;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBA6EX;AA7ED,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,6DAAQ,CAAA;IAER;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,mFAAmB,CAAA;IAEnB;;;;OAIG;IACH,mGAA2B,CAAA;IAE3B;;;;OAIG;IACH,uEAAa,CAAA;IAEb;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,wEAAc,CAAA;AAChB,CAAC,EA7EW,mBAAmB,KAAnB,mBAAmB,QA6E9B","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * WiFi plugin for managing device WiFi connectivity\n *\n * @since 7.0.0\n */\nexport interface CapacitorWifiPlugin {\n /**\n * Show a system dialog to add a Wi-Fi network to the device.\n * On Android SDK 30+, this opens the system Wi-Fi settings with the network pre-filled.\n * On iOS, this connects to the network directly.\n *\n * @param options - Network configuration options\n * @returns Promise that resolves when the network is added\n * @throws Error if adding the network fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addNetwork({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * isHiddenSsid: false,\n * securityType: NetworkSecurityType.WPA2_PSK\n * });\n * ```\n */\n addNetwork(options: AddNetworkOptions): Promise<void>;\n\n /**\n * Connect to a Wi-Fi network.\n * On Android, this creates a temporary connection that doesn't route traffic through the network by default.\n * Set autoRouteTraffic to true to bind app traffic to the connected network (useful for local/device-hosted APs).\n * For a persistent connection on Android, use addNetwork() instead.\n * On iOS, this creates a persistent connection.\n *\n * @param options - Connection options\n * @returns Promise that resolves when connected\n * @throws Error if connection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.connect({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * autoRouteTraffic: true // Android only: route app traffic through this network\n * });\n * ```\n */\n connect(options: ConnectOptions): Promise<void>;\n\n /**\n * Disconnect from the current Wi-Fi network.\n * On iOS, only disconnects from networks that were added via this plugin.\n *\n * @param options - Optional disconnect options\n * @returns Promise that resolves when disconnected\n * @throws Error if disconnection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.disconnect();\n * ```\n */\n disconnect(options?: DisconnectOptions): Promise<void>;\n\n /**\n * Get a list of available Wi-Fi networks from the last scan.\n * Only available on Android.\n *\n * @returns Promise that resolves with the list of networks\n * @throws Error if getting networks fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * networks.forEach(network => {\n * console.log(`SSID: ${network.ssid}, Signal: ${network.rssi} dBm`);\n * });\n * ```\n */\n getAvailableNetworks(): Promise<GetAvailableNetworksResult>;\n\n /**\n * Get the device's current IP address.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the IP address\n * @throws Error if getting IP address fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ipAddress } = await CapacitorWifi.getIpAddress();\n * console.log('IP Address:', ipAddress);\n * ```\n */\n getIpAddress(): Promise<GetIpAddressResult>;\n\n /**\n * Get the received signal strength indicator (RSSI) of the current network in dBm.\n * Only available on Android.\n *\n * @returns Promise that resolves with the RSSI value\n * @throws Error if getting RSSI fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { rssi } = await CapacitorWifi.getRssi();\n * console.log('Signal strength:', rssi, 'dBm');\n * ```\n */\n getRssi(): Promise<GetRssiResult>;\n\n /**\n * Get the service set identifier (SSID) of the current network.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the SSID\n * @throws Error if getting SSID fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ssid } = await CapacitorWifi.getSsid();\n * console.log('Connected to:', ssid);\n * ```\n */\n getSsid(): Promise<GetSsidResult>;\n\n /**\n * Check if Wi-Fi is enabled on the device.\n * Only available on Android.\n *\n * @returns Promise that resolves with the Wi-Fi enabled status\n * @throws Error if checking status fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { enabled } = await CapacitorWifi.isEnabled();\n * console.log('WiFi is', enabled ? 'enabled' : 'disabled');\n * ```\n */\n isEnabled(): Promise<IsEnabledResult>;\n\n /**\n * Start scanning for Wi-Fi networks.\n * Only available on Android.\n * Results are delivered via the 'networksScanned' event listener.\n * Note: May fail due to system throttling or hardware issues.\n *\n * @returns Promise that resolves when scan starts\n * @throws Error if scan fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addListener('networksScanned', () => {\n * console.log('Scan completed');\n * });\n * await CapacitorWifi.startScan();\n * ```\n */\n startScan(): Promise<void>;\n\n /**\n * Check the current permission status for location access.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @returns Promise that resolves with the permission status\n * @throws Error if checking permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.checkPermissions();\n * console.log('Location permission:', status.location);\n * ```\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions from the user.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @param options - Optional permission request options\n * @returns Promise that resolves with the updated permission status\n * @throws Error if requesting permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.requestPermissions();\n * if (status.location === 'granted') {\n * console.log('Permission granted');\n * }\n * ```\n */\n requestPermissions(options?: RequestPermissionsOptions): Promise<PermissionStatus>;\n\n /**\n * Add a listener for the 'networksScanned' event.\n * Only available on Android.\n * This event is fired when Wi-Fi scan results are available.\n *\n * @param eventName - The event name ('networksScanned')\n * @param listenerFunc - The callback function to execute\n * @returns Promise that resolves with a listener handle\n * @since 7.0.0\n * @example\n * ```typescript\n * const listener = await CapacitorWifi.addListener('networksScanned', async () => {\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * console.log('Found networks:', networks);\n * });\n * ```\n */\n addListener(eventName: 'networksScanned', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @returns Promise that resolves when all listeners are removed\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.removeAllListeners();\n * ```\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { version } = await CapacitorWifi.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n\n/**\n * Options for adding a network\n *\n * @since 7.0.0\n */\nexport interface AddNetworkOptions {\n /**\n * The SSID of the network to add\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * The security type of the network (Android only)\n *\n * @since 7.0.0\n * @default NetworkSecurityType.WPA2_PSK\n */\n securityType?: NetworkSecurityType;\n}\n\n/**\n * Options for connecting to a network\n *\n * @since 7.0.0\n */\nexport interface ConnectOptions {\n /**\n * The SSID of the network to connect to\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * Whether to automatically route app traffic through the connected Wi-Fi network (Android only)\n * When enabled, it binds the app process to the connected network using ConnectivityManager.bindProcessToNetwork()\n * This is useful for connecting to local/device-hosted APs (e.g., ESP32, IoT devices) that don't have internet access.\n *\n * @since 7.0.0\n * @default false\n */\n autoRouteTraffic?: boolean;\n}\n\n/**\n * Options for disconnecting from a network\n *\n * @since 7.0.0\n */\nexport interface DisconnectOptions {\n /**\n * The SSID of the network to disconnect from (optional)\n *\n * @since 7.0.0\n */\n ssid?: string;\n}\n\n/**\n * Result from getAvailableNetworks()\n *\n * @since 7.0.0\n */\nexport interface GetAvailableNetworksResult {\n /**\n * List of available networks\n *\n * @since 7.0.0\n */\n networks: Network[];\n}\n\n/**\n * Represents a Wi-Fi network\n *\n * @since 7.0.0\n */\nexport interface Network {\n /**\n * The SSID of the network\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n\n /**\n * The security types supported by this network (Android SDK 33+ only)\n *\n * @since 7.0.0\n */\n securityTypes?: NetworkSecurityType[];\n}\n\n/**\n * Result from getIpAddress()\n *\n * @since 7.0.0\n */\nexport interface GetIpAddressResult {\n /**\n * The device's IP address\n *\n * @since 7.0.0\n */\n ipAddress: string;\n}\n\n/**\n * Result from getRssi()\n *\n * @since 7.0.0\n */\nexport interface GetRssiResult {\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n}\n\n/**\n * Result from getSsid()\n *\n * @since 7.0.0\n */\nexport interface GetSsidResult {\n /**\n * The SSID of the current network\n *\n * @since 7.0.0\n */\n ssid: string;\n}\n\n/**\n * Result from isEnabled()\n *\n * @since 7.0.0\n */\nexport interface IsEnabledResult {\n /**\n * Whether Wi-Fi is enabled\n *\n * @since 7.0.0\n */\n enabled: boolean;\n}\n\n/**\n * Permission status\n *\n * @since 7.0.0\n */\nexport interface PermissionStatus {\n /**\n * Location permission state\n *\n * @since 7.0.0\n */\n location: PermissionState;\n}\n\n/**\n * Possible permission states\n *\n * @since 7.0.0\n */\nexport type PermissionState = 'granted' | 'denied' | 'prompt';\n\n/**\n * Options for requesting permissions\n *\n * @since 7.0.0\n */\nexport interface RequestPermissionsOptions {\n /**\n * Permissions to request\n *\n * @since 7.0.0\n */\n permissions?: 'location'[];\n}\n\n/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport enum NetworkSecurityType {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n OPEN = 0,\n\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n WEP = 1,\n\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n WPA2_PSK = 2,\n\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n EAP = 3,\n\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n SAE = 4,\n\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE = 5,\n\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE_192_BIT = 6,\n\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n PASSPOINT = 7,\n\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n OWE = 8,\n\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n WAPI_PSK = 9,\n\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n WAPI_CERT = 10,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA4hBA;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBA6EX;AA7ED,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,6DAAQ,CAAA;IAER;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,mFAAmB,CAAA;IAEnB;;;;OAIG;IACH,mGAA2B,CAAA;IAE3B;;;;OAIG;IACH,uEAAa,CAAA;IAEb;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,wEAAc,CAAA;AAChB,CAAC,EA7EW,mBAAmB,KAAnB,mBAAmB,QA6E9B","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * WiFi plugin for managing device WiFi connectivity\n *\n * @since 7.0.0\n */\nexport interface CapacitorWifiPlugin {\n /**\n * Show a system dialog to add a Wi-Fi network to the device.\n * On Android SDK 30+, this opens the system Wi-Fi settings with the network pre-filled.\n * On iOS, this connects to the network directly.\n *\n * @param options - Network configuration options\n * @returns Promise that resolves when the network is added\n * @throws Error if adding the network fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addNetwork({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * isHiddenSsid: false,\n * securityType: NetworkSecurityType.WPA2_PSK\n * });\n * ```\n */\n addNetwork(options: AddNetworkOptions): Promise<void>;\n\n /**\n * Connect to a Wi-Fi network.\n * On Android, this creates a temporary connection that doesn't route traffic through the network by default.\n * Set autoRouteTraffic to true to bind app traffic to the connected network (useful for local/device-hosted APs).\n * For a persistent connection on Android, use addNetwork() instead.\n * On iOS, this creates a persistent connection.\n *\n * @param options - Connection options\n * @returns Promise that resolves when connected\n * @throws Error if connection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.connect({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * autoRouteTraffic: true // Android only: route app traffic through this network\n * });\n * ```\n */\n connect(options: ConnectOptions): Promise<void>;\n\n /**\n * Disconnect from the current Wi-Fi network.\n * On iOS, only disconnects from networks that were added via this plugin.\n *\n * @param options - Optional disconnect options\n * @returns Promise that resolves when disconnected\n * @throws Error if disconnection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.disconnect();\n * ```\n */\n disconnect(options?: DisconnectOptions): Promise<void>;\n\n /**\n * Get a list of available Wi-Fi networks from the last scan.\n * Only available on Android.\n *\n * @returns Promise that resolves with the list of networks\n * @throws Error if getting networks fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * networks.forEach(network => {\n * console.log(`SSID: ${network.ssid}, Signal: ${network.rssi} dBm`);\n * });\n * ```\n */\n getAvailableNetworks(): Promise<GetAvailableNetworksResult>;\n\n /**\n * Get the device's current IP address.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the IP address\n * @throws Error if getting IP address fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ipAddress } = await CapacitorWifi.getIpAddress();\n * console.log('IP Address:', ipAddress);\n * ```\n */\n getIpAddress(): Promise<GetIpAddressResult>;\n\n /**\n * Get the received signal strength indicator (RSSI) of the current network in dBm.\n * Only available on Android.\n *\n * @returns Promise that resolves with the RSSI value\n * @throws Error if getting RSSI fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { rssi } = await CapacitorWifi.getRssi();\n * console.log('Signal strength:', rssi, 'dBm');\n * ```\n */\n getRssi(): Promise<GetRssiResult>;\n\n /**\n * Get the service set identifier (SSID) of the current network.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the SSID\n * @throws Error if getting SSID fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ssid } = await CapacitorWifi.getSsid();\n * console.log('Connected to:', ssid);\n * ```\n */\n getSsid(): Promise<GetSsidResult>;\n\n /**\n * Get comprehensive information about the currently connected WiFi network.\n * This method provides detailed network information including SSID, BSSID, IP address,\n * frequency, link speed, and signal strength in a single call.\n * On iOS, some fields may not be available and will be undefined.\n *\n * @returns Promise that resolves with the WiFi information\n * @throws Error if getting WiFi info fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const info = await CapacitorWifi.getWifiInfo();\n * console.log('Network:', info.ssid);\n * console.log('BSSID:', info.bssid);\n * console.log('IP:', info.ip);\n * console.log('Frequency:', info.frequency, 'MHz');\n * console.log('Speed:', info.linkSpeed, 'Mbps');\n * console.log('Signal:', info.signalStrength);\n * ```\n */\n getWifiInfo(): Promise<WifiInfo>;\n\n /**\n * Check if Wi-Fi is enabled on the device.\n * Only available on Android.\n *\n * @returns Promise that resolves with the Wi-Fi enabled status\n * @throws Error if checking status fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { enabled } = await CapacitorWifi.isEnabled();\n * console.log('WiFi is', enabled ? 'enabled' : 'disabled');\n * ```\n */\n isEnabled(): Promise<IsEnabledResult>;\n\n /**\n * Start scanning for Wi-Fi networks.\n * Only available on Android.\n * Results are delivered via the 'networksScanned' event listener.\n * Note: May fail due to system throttling or hardware issues.\n *\n * @returns Promise that resolves when scan starts\n * @throws Error if scan fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addListener('networksScanned', () => {\n * console.log('Scan completed');\n * });\n * await CapacitorWifi.startScan();\n * ```\n */\n startScan(): Promise<void>;\n\n /**\n * Check the current permission status for location access.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @returns Promise that resolves with the permission status\n * @throws Error if checking permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.checkPermissions();\n * console.log('Location permission:', status.location);\n * ```\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions from the user.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @param options - Optional permission request options\n * @returns Promise that resolves with the updated permission status\n * @throws Error if requesting permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.requestPermissions();\n * if (status.location === 'granted') {\n * console.log('Permission granted');\n * }\n * ```\n */\n requestPermissions(options?: RequestPermissionsOptions): Promise<PermissionStatus>;\n\n /**\n * Add a listener for the 'networksScanned' event.\n * Only available on Android.\n * This event is fired when Wi-Fi scan results are available.\n *\n * @param eventName - The event name ('networksScanned')\n * @param listenerFunc - The callback function to execute\n * @returns Promise that resolves with a listener handle\n * @since 7.0.0\n * @example\n * ```typescript\n * const listener = await CapacitorWifi.addListener('networksScanned', async () => {\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * console.log('Found networks:', networks);\n * });\n * ```\n */\n addListener(eventName: 'networksScanned', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @returns Promise that resolves when all listeners are removed\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.removeAllListeners();\n * ```\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { version } = await CapacitorWifi.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n\n/**\n * Options for adding a network\n *\n * @since 7.0.0\n */\nexport interface AddNetworkOptions {\n /**\n * The SSID of the network to add\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * The security type of the network (Android only)\n *\n * @since 7.0.0\n * @default NetworkSecurityType.WPA2_PSK\n */\n securityType?: NetworkSecurityType;\n}\n\n/**\n * Options for connecting to a network\n *\n * @since 7.0.0\n */\nexport interface ConnectOptions {\n /**\n * The SSID of the network to connect to\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * Whether to automatically route app traffic through the connected Wi-Fi network (Android only)\n * When enabled, it binds the app process to the connected network using ConnectivityManager.bindProcessToNetwork()\n * This is useful for connecting to local/device-hosted APs (e.g., ESP32, IoT devices) that don't have internet access.\n *\n * @since 7.0.0\n * @default false\n */\n autoRouteTraffic?: boolean;\n}\n\n/**\n * Options for disconnecting from a network\n *\n * @since 7.0.0\n */\nexport interface DisconnectOptions {\n /**\n * The SSID of the network to disconnect from (optional)\n *\n * @since 7.0.0\n */\n ssid?: string;\n}\n\n/**\n * Result from getAvailableNetworks()\n *\n * @since 7.0.0\n */\nexport interface GetAvailableNetworksResult {\n /**\n * List of available networks\n *\n * @since 7.0.0\n */\n networks: Network[];\n}\n\n/**\n * Represents a Wi-Fi network\n *\n * @since 7.0.0\n */\nexport interface Network {\n /**\n * The SSID of the network\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n\n /**\n * The security types supported by this network (Android SDK 33+ only)\n *\n * @since 7.0.0\n */\n securityTypes?: NetworkSecurityType[];\n}\n\n/**\n * Result from getIpAddress()\n *\n * @since 7.0.0\n */\nexport interface GetIpAddressResult {\n /**\n * The device's IP address\n *\n * @since 7.0.0\n */\n ipAddress: string;\n}\n\n/**\n * Result from getRssi()\n *\n * @since 7.0.0\n */\nexport interface GetRssiResult {\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n}\n\n/**\n * Result from getSsid()\n *\n * @since 7.0.0\n */\nexport interface GetSsidResult {\n /**\n * The SSID of the current network\n *\n * @since 7.0.0\n */\n ssid: string;\n}\n\n/**\n * Comprehensive WiFi information\n *\n * @since 7.0.0\n */\nexport interface WifiInfo {\n /**\n * The SSID (network name) of the current network\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The BSSID (MAC address) of the access point.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n bssid?: string;\n\n /**\n * The device's IP address on the network\n *\n * @since 7.0.0\n */\n ip: string;\n\n /**\n * The network frequency in MHz.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n frequency?: number;\n\n /**\n * The connection speed in Mbps.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n linkSpeed?: number;\n\n /**\n * The signal strength (0-100).\n * Calculated from RSSI on Android.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n signalStrength?: number;\n}\n\n/**\n * Result from isEnabled()\n *\n * @since 7.0.0\n */\nexport interface IsEnabledResult {\n /**\n * Whether Wi-Fi is enabled\n *\n * @since 7.0.0\n */\n enabled: boolean;\n}\n\n/**\n * Permission status\n *\n * @since 7.0.0\n */\nexport interface PermissionStatus {\n /**\n * Location permission state\n *\n * @since 7.0.0\n */\n location: PermissionState;\n}\n\n/**\n * Possible permission states\n *\n * @since 7.0.0\n */\nexport type PermissionState = 'granted' | 'denied' | 'prompt';\n\n/**\n * Options for requesting permissions\n *\n * @since 7.0.0\n */\nexport interface RequestPermissionsOptions {\n /**\n * Permissions to request\n *\n * @since 7.0.0\n */\n permissions?: 'location'[];\n}\n\n/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport enum NetworkSecurityType {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n OPEN = 0,\n\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n WEP = 1,\n\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n WPA2_PSK = 2,\n\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n EAP = 3,\n\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n SAE = 4,\n\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE = 5,\n\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE_192_BIT = 6,\n\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n PASSPOINT = 7,\n\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n OWE = 8,\n\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n WAPI_PSK = 9,\n\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n WAPI_CERT = 10,\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { AddNetworkOptions, CapacitorWifiPlugin, ConnectOptions, DisconnectOptions, GetAvailableNetworksResult, GetIpAddressResult, GetRssiResult, GetSsidResult, IsEnabledResult, PermissionStatus, RequestPermissionsOptions } from './definitions';
|
|
2
|
+
import type { AddNetworkOptions, CapacitorWifiPlugin, ConnectOptions, DisconnectOptions, GetAvailableNetworksResult, GetIpAddressResult, GetRssiResult, GetSsidResult, IsEnabledResult, PermissionStatus, RequestPermissionsOptions, WifiInfo } from './definitions';
|
|
3
3
|
export declare class CapacitorWifiWeb extends WebPlugin implements CapacitorWifiPlugin {
|
|
4
4
|
addNetwork(_options: AddNetworkOptions): Promise<void>;
|
|
5
5
|
connect(_options: ConnectOptions): Promise<void>;
|
|
@@ -8,6 +8,7 @@ export declare class CapacitorWifiWeb extends WebPlugin implements CapacitorWifi
|
|
|
8
8
|
getIpAddress(): Promise<GetIpAddressResult>;
|
|
9
9
|
getRssi(): Promise<GetRssiResult>;
|
|
10
10
|
getSsid(): Promise<GetSsidResult>;
|
|
11
|
+
getWifiInfo(): Promise<WifiInfo>;
|
|
11
12
|
isEnabled(): Promise<IsEnabledResult>;
|
|
12
13
|
startScan(): Promise<void>;
|
|
13
14
|
checkPermissions(): Promise<PermissionStatus>;
|
package/dist/esm/web.js
CHANGED
|
@@ -21,6 +21,9 @@ export class CapacitorWifiWeb extends WebPlugin {
|
|
|
21
21
|
async getSsid() {
|
|
22
22
|
throw this.unimplemented('Not implemented on web.');
|
|
23
23
|
}
|
|
24
|
+
async getWifiInfo() {
|
|
25
|
+
throw this.unimplemented('Not implemented on web.');
|
|
26
|
+
}
|
|
24
27
|
async isEnabled() {
|
|
25
28
|
throw this.unimplemented('Not implemented on web.');
|
|
26
29
|
}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"A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AAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAoC;QAC3D,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AddNetworkOptions,\n CapacitorWifiPlugin,\n ConnectOptions,\n DisconnectOptions,\n GetAvailableNetworksResult,\n GetIpAddressResult,\n GetRssiResult,\n GetSsidResult,\n IsEnabledResult,\n PermissionStatus,\n RequestPermissionsOptions,\n WifiInfo,\n} from './definitions';\n\nexport class CapacitorWifiWeb extends WebPlugin implements CapacitorWifiPlugin {\n async addNetwork(_options: AddNetworkOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async connect(_options: ConnectOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async disconnect(_options?: DisconnectOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getAvailableNetworks(): Promise<GetAvailableNetworksResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getIpAddress(): Promise<GetIpAddressResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getRssi(): Promise<GetRssiResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getSsid(): Promise<GetSsidResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getWifiInfo(): Promise<WifiInfo> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isEnabled(): Promise<IsEnabledResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async startScan(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestPermissions(_options?: RequestPermissionsOptions): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: '1.0.0' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -103,6 +103,9 @@ class CapacitorWifiWeb extends core.WebPlugin {
|
|
|
103
103
|
async getSsid() {
|
|
104
104
|
throw this.unimplemented('Not implemented on web.');
|
|
105
105
|
}
|
|
106
|
+
async getWifiInfo() {
|
|
107
|
+
throw this.unimplemented('Not implemented on web.');
|
|
108
|
+
}
|
|
106
109
|
async isEnabled() {
|
|
107
110
|
throw this.unimplemented('Not implemented on web.');
|
|
108
111
|
}
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport var NetworkSecurityType;\n(function (NetworkSecurityType) {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OPEN\"] = 0] = \"OPEN\";\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WEP\"] = 1] = \"WEP\";\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA2_PSK\"] = 2] = \"WPA2_PSK\";\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"EAP\"] = 3] = \"EAP\";\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"SAE\"] = 4] = \"SAE\";\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE\"] = 5] = \"WPA3_ENTERPRISE\";\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE_192_BIT\"] = 6] = \"WPA3_ENTERPRISE_192_BIT\";\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"PASSPOINT\"] = 7] = \"PASSPOINT\";\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OWE\"] = 8] = \"OWE\";\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_PSK\"] = 9] = \"WAPI_PSK\";\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_CERT\"] = 10] = \"WAPI_CERT\";\n})(NetworkSecurityType || (NetworkSecurityType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorWifi = registerPlugin('CapacitorWifi', {\n web: () => import('./web').then((m) => new m.CapacitorWifiWeb()),\n});\nexport * from './definitions';\nexport { CapacitorWifi };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorWifiWeb extends WebPlugin {\n async addNetwork(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async disconnect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAvailableNetworks() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getIpAddress() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getRssi() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getSsid() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isEnabled() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startScan() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: '1.0.0' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NetworkSecurityType","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACWA;AACX,CAAC,UAAU,mBAAmB,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACjE;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AACzE;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,iBAAiB;AACvF;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB;AACvG;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;AAC3E;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;A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;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;AACnC,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport var NetworkSecurityType;\n(function (NetworkSecurityType) {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OPEN\"] = 0] = \"OPEN\";\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WEP\"] = 1] = \"WEP\";\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA2_PSK\"] = 2] = \"WPA2_PSK\";\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"EAP\"] = 3] = \"EAP\";\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"SAE\"] = 4] = \"SAE\";\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE\"] = 5] = \"WPA3_ENTERPRISE\";\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE_192_BIT\"] = 6] = \"WPA3_ENTERPRISE_192_BIT\";\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"PASSPOINT\"] = 7] = \"PASSPOINT\";\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OWE\"] = 8] = \"OWE\";\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_PSK\"] = 9] = \"WAPI_PSK\";\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_CERT\"] = 10] = \"WAPI_CERT\";\n})(NetworkSecurityType || (NetworkSecurityType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorWifi = registerPlugin('CapacitorWifi', {\n web: () => import('./web').then((m) => new m.CapacitorWifiWeb()),\n});\nexport * from './definitions';\nexport { CapacitorWifi };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorWifiWeb extends WebPlugin {\n async addNetwork(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async disconnect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAvailableNetworks() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getIpAddress() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getRssi() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getSsid() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getWifiInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isEnabled() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startScan() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: '1.0.0' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NetworkSecurityType","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACWA;AACX,CAAC,UAAU,mBAAmB,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACjE;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AACzE;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,iBAAiB;AACvF;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB;AACvG;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;AAC3E;AACA;AACA;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,mBA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WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;AACnC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -102,6 +102,9 @@ var capacitorCapgoWifi = (function (exports, core) {
|
|
|
102
102
|
async getSsid() {
|
|
103
103
|
throw this.unimplemented('Not implemented on web.');
|
|
104
104
|
}
|
|
105
|
+
async getWifiInfo() {
|
|
106
|
+
throw this.unimplemented('Not implemented on web.');
|
|
107
|
+
}
|
|
105
108
|
async isEnabled() {
|
|
106
109
|
throw this.unimplemented('Not implemented on web.');
|
|
107
110
|
}
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport var NetworkSecurityType;\n(function (NetworkSecurityType) {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OPEN\"] = 0] = \"OPEN\";\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WEP\"] = 1] = \"WEP\";\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA2_PSK\"] = 2] = \"WPA2_PSK\";\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"EAP\"] = 3] = \"EAP\";\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"SAE\"] = 4] = \"SAE\";\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE\"] = 5] = \"WPA3_ENTERPRISE\";\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE_192_BIT\"] = 6] = \"WPA3_ENTERPRISE_192_BIT\";\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"PASSPOINT\"] = 7] = \"PASSPOINT\";\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OWE\"] = 8] = \"OWE\";\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_PSK\"] = 9] = \"WAPI_PSK\";\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_CERT\"] = 10] = \"WAPI_CERT\";\n})(NetworkSecurityType || (NetworkSecurityType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorWifi = registerPlugin('CapacitorWifi', {\n web: () => import('./web').then((m) => new m.CapacitorWifiWeb()),\n});\nexport * from './definitions';\nexport { CapacitorWifi };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorWifiWeb extends WebPlugin {\n async addNetwork(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async disconnect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAvailableNetworks() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getIpAddress() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getRssi() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getSsid() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isEnabled() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startScan() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: '1.0.0' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NetworkSecurityType","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,mBAAmB,EAAE;IAChC;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACjE;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACzE;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC/D;IACA;IACA;IACA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a,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,oBAAoB,GAAG;IACjC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;IACnC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport var NetworkSecurityType;\n(function (NetworkSecurityType) {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OPEN\"] = 0] = \"OPEN\";\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WEP\"] = 1] = \"WEP\";\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA2_PSK\"] = 2] = \"WPA2_PSK\";\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"EAP\"] = 3] = \"EAP\";\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"SAE\"] = 4] = \"SAE\";\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE\"] = 5] = \"WPA3_ENTERPRISE\";\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE_192_BIT\"] = 6] = \"WPA3_ENTERPRISE_192_BIT\";\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"PASSPOINT\"] = 7] = \"PASSPOINT\";\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OWE\"] = 8] = \"OWE\";\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_PSK\"] = 9] = \"WAPI_PSK\";\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_CERT\"] = 10] = \"WAPI_CERT\";\n})(NetworkSecurityType || (NetworkSecurityType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorWifi = registerPlugin('CapacitorWifi', {\n web: () => import('./web').then((m) => new m.CapacitorWifiWeb()),\n});\nexport * from './definitions';\nexport { CapacitorWifi };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorWifiWeb extends WebPlugin {\n async addNetwork(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async disconnect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAvailableNetworks() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getIpAddress() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getRssi() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getSsid() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getWifiInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isEnabled() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startScan() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getPluginVersion() {\n return { version: '1.0.0' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NetworkSecurityType","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,mBAAmB,EAAE;IAChC;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACjE;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACzE;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB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iPlugin)
|
|
8
8
|
public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
9
|
-
private let pluginVersion: String = "8.1.
|
|
9
|
+
private let pluginVersion: String = "8.1.3"
|
|
10
10
|
public let identifier = "CapacitorWifiPlugin"
|
|
11
11
|
public let jsName = "CapacitorWifi"
|
|
12
12
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -17,6 +17,7 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
17
17
|
CAPPluginMethod(name: "getIpAddress", returnType: CAPPluginReturnPromise),
|
|
18
18
|
CAPPluginMethod(name: "getRssi", returnType: CAPPluginReturnPromise),
|
|
19
19
|
CAPPluginMethod(name: "getSsid", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "getWifiInfo", returnType: CAPPluginReturnPromise),
|
|
20
21
|
CAPPluginMethod(name: "isEnabled", returnType: CAPPluginReturnPromise),
|
|
21
22
|
CAPPluginMethod(name: "startScan", returnType: CAPPluginReturnPromise),
|
|
22
23
|
CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
|
|
@@ -148,6 +149,28 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
@objc func getWifiInfo(_ call: CAPPluginCall) {
|
|
153
|
+
guard let ssid = getCurrentSSID() else {
|
|
154
|
+
call.reject("Failed to get SSID")
|
|
155
|
+
return
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var result: [String: Any] = ["ssid": ssid]
|
|
159
|
+
|
|
160
|
+
// Get IP Address
|
|
161
|
+
if let ipAddress = getIPAddress() {
|
|
162
|
+
result["ip"] = ipAddress
|
|
163
|
+
} else {
|
|
164
|
+
call.reject("Failed to get IP address")
|
|
165
|
+
return
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Note: BSSID, frequency, linkSpeed, and signalStrength are not available on iOS
|
|
169
|
+
// through public APIs, so we only return ssid and ip
|
|
170
|
+
|
|
171
|
+
call.resolve(result)
|
|
172
|
+
}
|
|
173
|
+
|
|
151
174
|
@objc func isEnabled(_ call: CAPPluginCall) {
|
|
152
175
|
call.reject("Not supported on iOS")
|
|
153
176
|
}
|
|
@@ -182,6 +205,36 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
182
205
|
return currentSSID
|
|
183
206
|
}
|
|
184
207
|
|
|
208
|
+
private func getIPAddress() -> String? {
|
|
209
|
+
var address: String?
|
|
210
|
+
var ifaddr: UnsafeMutablePointer<ifaddrs>?
|
|
211
|
+
|
|
212
|
+
guard getifaddrs(&ifaddr) == 0, let firstAddr = ifaddr else {
|
|
213
|
+
return nil
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
defer { freeifaddrs(ifaddr) }
|
|
217
|
+
|
|
218
|
+
for ptr in sequence(first: firstAddr, next: { $0.pointee.ifa_next }) {
|
|
219
|
+
let interface = ptr.pointee
|
|
220
|
+
let addrFamily = interface.ifa_addr.pointee.sa_family
|
|
221
|
+
|
|
222
|
+
if addrFamily == UInt8(AF_INET) || addrFamily == UInt8(AF_INET6) {
|
|
223
|
+
let name = String(cString: interface.ifa_name)
|
|
224
|
+
if name == "en0" {
|
|
225
|
+
var hostname = [CChar](repeating: 0, count: Int(NI_MAXHOST))
|
|
226
|
+
getnameinfo(interface.ifa_addr, socklen_t(interface.ifa_addr.pointee.sa_len),
|
|
227
|
+
&hostname, socklen_t(hostname.count),
|
|
228
|
+
nil, socklen_t(0), NI_NUMERICHOST)
|
|
229
|
+
address = String(cString: hostname)
|
|
230
|
+
break
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return address
|
|
236
|
+
}
|
|
237
|
+
|
|
185
238
|
private func getLocationPermissionStatus() -> String {
|
|
186
239
|
switch CLLocationManager.authorizationStatus() {
|
|
187
240
|
case .authorizedAlways, .authorizedWhenInUse:
|