@capgo/capacitor-wifi 8.3.5 → 8.4.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/README.md +68 -0
- package/android/src/main/java/ee/forgr/plugin/capacitor_wifi/CapacitorWifiPlugin.java +78 -2
- package/dist/docs.json +250 -0
- package/dist/esm/definitions.d.ts +126 -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 +41 -1
- package/ios/Sources/CapacitorWifiPlugin/WifiNetworkSharingHelper.swift +146 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ npx cap sync
|
|
|
80
80
|
* [`addListener('networksScanned', ...)`](#addlistenernetworksscanned-)
|
|
81
81
|
* [`removeAllListeners()`](#removealllisteners)
|
|
82
82
|
* [`isNetworkSaved(...)`](#isnetworksaved)
|
|
83
|
+
* [`shareNetwork(...)`](#sharenetwork)
|
|
83
84
|
* [`getPluginVersion()`](#getpluginversion)
|
|
84
85
|
* [Interfaces](#interfaces)
|
|
85
86
|
* [Type Aliases](#type-aliases)
|
|
@@ -358,6 +359,33 @@ Use this to decide whether to call addNetwork() (first time) or connect() (alrea
|
|
|
358
359
|
--------------------
|
|
359
360
|
|
|
360
361
|
|
|
362
|
+
### shareNetwork(...)
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
shareNetwork(options?: ShareNetworkOptions | undefined) => Promise<ShareNetworkResult>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Share Wi-Fi network credentials using platform-native sharing flows.
|
|
369
|
+
|
|
370
|
+
On Android 10+, this uses Wi-Fi Easy Connect (DPP). When `dppUri` is provided, the system
|
|
371
|
+
provisions credentials to the target device. Otherwise, it opens the system UI to share the
|
|
372
|
+
current or specified network (optionally via QR code when `ssid` and `password` are provided).
|
|
373
|
+
|
|
374
|
+
On iOS 26.2+, this uses the Wi-Fi Infrastructure framework with a paired AccessorySetupKit
|
|
375
|
+
accessory. The host app must pair the accessory first and pass its `bluetoothIdentifier` or
|
|
376
|
+
`accessoryIdentifier`. The app also needs the `com.apple.developer.wifi-infrastructure` entitlement.
|
|
377
|
+
|
|
378
|
+
| Param | Type | Description |
|
|
379
|
+
| ------------- | ------------------------------------------------------------------- | ----------------- |
|
|
380
|
+
| **`options`** | <code><a href="#sharenetworkoptions">ShareNetworkOptions</a></code> | - Sharing options |
|
|
381
|
+
|
|
382
|
+
**Returns:** <code>Promise<<a href="#sharenetworkresult">ShareNetworkResult</a>></code>
|
|
383
|
+
|
|
384
|
+
**Since:** 8.4.0
|
|
385
|
+
|
|
386
|
+
--------------------
|
|
387
|
+
|
|
388
|
+
|
|
361
389
|
### getPluginVersion()
|
|
362
390
|
|
|
363
391
|
```typescript
|
|
@@ -522,6 +550,32 @@ Options for checking whether a network is saved
|
|
|
522
550
|
| **`ssid`** | <code>string</code> | The SSID of the network to check | 8.2.0 |
|
|
523
551
|
|
|
524
552
|
|
|
553
|
+
#### ShareNetworkResult
|
|
554
|
+
|
|
555
|
+
Result from shareNetwork()
|
|
556
|
+
|
|
557
|
+
| Prop | Type | Description | Since |
|
|
558
|
+
| ------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----- |
|
|
559
|
+
| **`started`** | <code>boolean</code> | Whether the platform sharing flow was started or completed. | 8.4.0 |
|
|
560
|
+
| **`authorizationState`** | <code><a href="#wifisharingauthorizationstate">WifiSharingAuthorizationState</a></code> | iOS: Authorization state after `requestAuthorization`, when requested. | 8.4.0 |
|
|
561
|
+
| **`askToShareState`** | <code><a href="#wifisharingaskstate">WifiSharingAskState</a></code> | iOS: Result of `askToShare` when requested. | 8.4.0 |
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
#### ShareNetworkOptions
|
|
565
|
+
|
|
566
|
+
Options for sharing Wi-Fi network credentials
|
|
567
|
+
|
|
568
|
+
| Prop | Type | Description | Default | Since |
|
|
569
|
+
| -------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
|
|
570
|
+
| **`dppUri`** | <code>string</code> | Android: Wi-Fi Easy Connect (DPP) URI from the target device. When provided, launches the system UI to provision Wi-Fi credentials to that device. | | 8.4.0 |
|
|
571
|
+
| **`ssid`** | <code>string</code> | <a href="#network">Network</a> SSID to share via QR code on Android. When omitted, the system uses the currently connected network when possible. | | 8.4.0 |
|
|
572
|
+
| **`password`** | <code>string</code> | <a href="#network">Network</a> password for QR code sharing on Android. Required when sharing a specific WPA/WPA2/WPA3 network via QR code. iOS does not allow reading saved Wi-Fi passwords from the system. | | 8.4.0 |
|
|
573
|
+
| **`bluetoothIdentifier`** | <code>string</code> | iOS 26.2+: Bluetooth identifier of a paired AccessorySetupKit accessory. Required for Wi-Fi Infrastructure network sharing on iOS unless `accessoryIdentifier` is set. | | 8.4.0 |
|
|
574
|
+
| **`accessoryIdentifier`** | <code>string</code> | iOS 26.2+: Accessory UUID from AccessorySetupKit. Alternative lookup key when `bluetoothIdentifier` is unavailable. | | 8.4.0 |
|
|
575
|
+
| **`requestAuthorization`** | <code>boolean</code> | iOS 26.2+: Request initial Wi-Fi network sharing authorization for the accessory. | <code>false</code> | 8.4.0 |
|
|
576
|
+
| **`askToShare`** | <code>boolean</code> | iOS 26.2+: Prompt the user to share the current Wi-Fi network with the accessory. | <code>true</code> | 8.4.0 |
|
|
577
|
+
|
|
578
|
+
|
|
525
579
|
### Type Aliases
|
|
526
580
|
|
|
527
581
|
|
|
@@ -530,6 +584,20 @@ Options for checking whether a network is saved
|
|
|
530
584
|
<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>
|
|
531
585
|
|
|
532
586
|
|
|
587
|
+
#### WifiSharingAuthorizationState
|
|
588
|
+
|
|
589
|
+
Authorization state returned by iOS Wi-Fi Infrastructure sharing
|
|
590
|
+
|
|
591
|
+
<code>'authorized' | 'denied' | 'notDetermined' | 'unsupported'</code>
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
#### WifiSharingAskState
|
|
595
|
+
|
|
596
|
+
Result state returned by iOS Wi-Fi Infrastructure askToShare()
|
|
597
|
+
|
|
598
|
+
<code>'shared' | 'declined' | 'cancelled' | 'notNeeded' | 'unsupported'</code>
|
|
599
|
+
|
|
600
|
+
|
|
533
601
|
### Enums
|
|
534
602
|
|
|
535
603
|
|
|
@@ -12,6 +12,7 @@ import android.net.Network;
|
|
|
12
12
|
import android.net.NetworkCapabilities;
|
|
13
13
|
import android.net.NetworkRequest;
|
|
14
14
|
import android.net.NetworkSpecifier;
|
|
15
|
+
import android.net.Uri;
|
|
15
16
|
import android.net.wifi.ScanResult;
|
|
16
17
|
import android.net.wifi.WifiConfiguration;
|
|
17
18
|
import android.net.wifi.WifiInfo;
|
|
@@ -49,14 +50,21 @@ import java.util.List;
|
|
|
49
50
|
)
|
|
50
51
|
public class CapacitorWifiPlugin extends Plugin {
|
|
51
52
|
|
|
52
|
-
private final String pluginVersion = "8.
|
|
53
|
+
private final String pluginVersion = "8.4.0";
|
|
53
54
|
|
|
54
55
|
private WifiManager wifiManager;
|
|
55
56
|
private ConnectivityManager connectivityManager;
|
|
56
57
|
private BroadcastReceiver scanResultsReceiver;
|
|
57
58
|
private ConnectivityManager.NetworkCallback networkCallback;
|
|
58
59
|
private Network boundNetwork; // Store the network we bound to for unbinding
|
|
59
|
-
private final Object boundNetworkLock = new Object();
|
|
60
|
+
private final Object boundNetworkLock = new Object();
|
|
61
|
+
private static final String ACTION_WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR = "android.settings.WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR";
|
|
62
|
+
private static final String EXTRA_WIFI_SECURITY = "wifi_security";
|
|
63
|
+
private static final String EXTRA_WIFI_SSID = "wifi_ssid";
|
|
64
|
+
private static final String EXTRA_WIFI_PRE_SHARED_KEY = "wifi_psk";
|
|
65
|
+
private static final int WIFI_SECURITY_WPA_PSK = 2;
|
|
66
|
+
|
|
67
|
+
// Lock for thread-safe access to boundNetwork
|
|
60
68
|
|
|
61
69
|
@Override
|
|
62
70
|
public void load() {
|
|
@@ -755,6 +763,74 @@ public class CapacitorWifiPlugin extends Plugin {
|
|
|
755
763
|
return false;
|
|
756
764
|
}
|
|
757
765
|
|
|
766
|
+
@PluginMethod
|
|
767
|
+
public void shareNetwork(PluginCall call) {
|
|
768
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
|
769
|
+
call.reject("Wi-Fi credential sharing requires Android 10 or later");
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
if (!wifiManager.isEasyConnectSupported()) {
|
|
774
|
+
call.reject("Wi-Fi Easy Connect is not supported on this device");
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
String dppUri = call.getString("dppUri");
|
|
779
|
+
if (dppUri != null && !dppUri.isEmpty()) {
|
|
780
|
+
shareNetworkViaDppUri(call, dppUri);
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
shareNetworkViaQrGenerator(call);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
private void shareNetworkViaDppUri(PluginCall call, String dppUri) {
|
|
788
|
+
try {
|
|
789
|
+
Intent intent = new Intent(Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_URI);
|
|
790
|
+
intent.setData(Uri.parse(dppUri));
|
|
791
|
+
startActivityForResult(call, intent, "handleShareNetworkResult");
|
|
792
|
+
} catch (Exception e) {
|
|
793
|
+
call.reject("Failed to start Wi-Fi Easy Connect flow: " + e.getMessage(), e);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
private void shareNetworkViaQrGenerator(PluginCall call) {
|
|
798
|
+
try {
|
|
799
|
+
Intent intent = new Intent(ACTION_WIFI_DPP_CONFIGURATOR_QR_CODE_GENERATOR);
|
|
800
|
+
|
|
801
|
+
String ssid = call.getString("ssid");
|
|
802
|
+
String password = call.getString("password");
|
|
803
|
+
|
|
804
|
+
if (ssid != null && !ssid.isEmpty()) {
|
|
805
|
+
intent.putExtra(EXTRA_WIFI_SSID, ssid);
|
|
806
|
+
if (password != null && !password.isEmpty()) {
|
|
807
|
+
intent.putExtra(EXTRA_WIFI_SECURITY, WIFI_SECURITY_WPA_PSK);
|
|
808
|
+
intent.putExtra(EXTRA_WIFI_PRE_SHARED_KEY, password);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
startActivityForResult(call, intent, "handleShareNetworkResult");
|
|
813
|
+
} catch (Exception e) {
|
|
814
|
+
call.reject("Failed to start Wi-Fi sharing UI: " + e.getMessage(), e);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
@ActivityCallback
|
|
819
|
+
private void handleShareNetworkResult(@Nullable PluginCall call, ActivityResult result) {
|
|
820
|
+
if (call == null) {
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if (result.getResultCode() != RESULT_OK) {
|
|
825
|
+
call.reject("Wi-Fi sharing was canceled");
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
JSObject ret = new JSObject();
|
|
830
|
+
ret.put("started", true);
|
|
831
|
+
call.resolve(ret);
|
|
832
|
+
}
|
|
833
|
+
|
|
758
834
|
@PluginMethod
|
|
759
835
|
public void getPluginVersion(final PluginCall call) {
|
|
760
836
|
try {
|
package/dist/docs.json
CHANGED
|
@@ -504,6 +504,46 @@
|
|
|
504
504
|
],
|
|
505
505
|
"slug": "isnetworksaved"
|
|
506
506
|
},
|
|
507
|
+
{
|
|
508
|
+
"name": "shareNetwork",
|
|
509
|
+
"signature": "(options?: ShareNetworkOptions | undefined) => Promise<ShareNetworkResult>",
|
|
510
|
+
"parameters": [
|
|
511
|
+
{
|
|
512
|
+
"name": "options",
|
|
513
|
+
"docs": "- Sharing options",
|
|
514
|
+
"type": "ShareNetworkOptions | undefined"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
"returns": "Promise<ShareNetworkResult>",
|
|
518
|
+
"tags": [
|
|
519
|
+
{
|
|
520
|
+
"name": "param",
|
|
521
|
+
"text": "options - Sharing options"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "returns",
|
|
525
|
+
"text": "Promise that resolves when the sharing flow starts or completes"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"name": "throws",
|
|
529
|
+
"text": "Error if sharing is unavailable or fails"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "since",
|
|
533
|
+
"text": "8.4.0"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "example",
|
|
537
|
+
"text": "```typescript\n// Android: provision credentials to an IoT device via DPP URI\nawait CapacitorWifi.shareNetwork({ dppUri: 'DPP:...' });\n\n// Android: show system UI to share the current network\nawait CapacitorWifi.shareNetwork();\n\n// iOS: share with a paired Bluetooth accessory\nawait CapacitorWifi.shareNetwork({\n bluetoothIdentifier: accessory.bluetoothIdentifier,\n requestAuthorization: true,\n askToShare: true,\n});\n```"
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"docs": "Share Wi-Fi network credentials using platform-native sharing flows.\n\nOn Android 10+, this uses Wi-Fi Easy Connect (DPP). When `dppUri` is provided, the system\nprovisions credentials to the target device. Otherwise, it opens the system UI to share the\ncurrent or specified network (optionally via QR code when `ssid` and `password` are provided).\n\nOn iOS 26.2+, this uses the Wi-Fi Infrastructure framework with a paired AccessorySetupKit\naccessory. The host app must pair the accessory first and pass its `bluetoothIdentifier` or\n`accessoryIdentifier`. The app also needs the `com.apple.developer.wifi-infrastructure` entitlement.",
|
|
541
|
+
"complexTypes": [
|
|
542
|
+
"ShareNetworkResult",
|
|
543
|
+
"ShareNetworkOptions"
|
|
544
|
+
],
|
|
545
|
+
"slug": "sharenetwork"
|
|
546
|
+
},
|
|
507
547
|
{
|
|
508
548
|
"name": "getPluginVersion",
|
|
509
549
|
"signature": "() => Promise<{ version: string; }>",
|
|
@@ -1094,6 +1134,166 @@
|
|
|
1094
1134
|
"type": "string"
|
|
1095
1135
|
}
|
|
1096
1136
|
]
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"name": "ShareNetworkResult",
|
|
1140
|
+
"slug": "sharenetworkresult",
|
|
1141
|
+
"docs": "Result from shareNetwork()",
|
|
1142
|
+
"tags": [
|
|
1143
|
+
{
|
|
1144
|
+
"text": "8.4.0",
|
|
1145
|
+
"name": "since"
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
"methods": [],
|
|
1149
|
+
"properties": [
|
|
1150
|
+
{
|
|
1151
|
+
"name": "started",
|
|
1152
|
+
"tags": [
|
|
1153
|
+
{
|
|
1154
|
+
"text": "8.4.0",
|
|
1155
|
+
"name": "since"
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
"docs": "Whether the platform sharing flow was started or completed.",
|
|
1159
|
+
"complexTypes": [],
|
|
1160
|
+
"type": "boolean"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"name": "authorizationState",
|
|
1164
|
+
"tags": [
|
|
1165
|
+
{
|
|
1166
|
+
"text": "8.4.0",
|
|
1167
|
+
"name": "since"
|
|
1168
|
+
}
|
|
1169
|
+
],
|
|
1170
|
+
"docs": "iOS: Authorization state after `requestAuthorization`, when requested.",
|
|
1171
|
+
"complexTypes": [
|
|
1172
|
+
"WifiSharingAuthorizationState"
|
|
1173
|
+
],
|
|
1174
|
+
"type": "WifiSharingAuthorizationState"
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
"name": "askToShareState",
|
|
1178
|
+
"tags": [
|
|
1179
|
+
{
|
|
1180
|
+
"text": "8.4.0",
|
|
1181
|
+
"name": "since"
|
|
1182
|
+
}
|
|
1183
|
+
],
|
|
1184
|
+
"docs": "iOS: Result of `askToShare` when requested.",
|
|
1185
|
+
"complexTypes": [
|
|
1186
|
+
"WifiSharingAskState"
|
|
1187
|
+
],
|
|
1188
|
+
"type": "WifiSharingAskState"
|
|
1189
|
+
}
|
|
1190
|
+
]
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"name": "ShareNetworkOptions",
|
|
1194
|
+
"slug": "sharenetworkoptions",
|
|
1195
|
+
"docs": "Options for sharing Wi-Fi network credentials",
|
|
1196
|
+
"tags": [
|
|
1197
|
+
{
|
|
1198
|
+
"text": "8.4.0",
|
|
1199
|
+
"name": "since"
|
|
1200
|
+
}
|
|
1201
|
+
],
|
|
1202
|
+
"methods": [],
|
|
1203
|
+
"properties": [
|
|
1204
|
+
{
|
|
1205
|
+
"name": "dppUri",
|
|
1206
|
+
"tags": [
|
|
1207
|
+
{
|
|
1208
|
+
"text": "8.4.0",
|
|
1209
|
+
"name": "since"
|
|
1210
|
+
}
|
|
1211
|
+
],
|
|
1212
|
+
"docs": "Android: Wi-Fi Easy Connect (DPP) URI from the target device.\nWhen provided, launches the system UI to provision Wi-Fi credentials to that device.",
|
|
1213
|
+
"complexTypes": [],
|
|
1214
|
+
"type": "string | undefined"
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
"name": "ssid",
|
|
1218
|
+
"tags": [
|
|
1219
|
+
{
|
|
1220
|
+
"text": "8.4.0",
|
|
1221
|
+
"name": "since"
|
|
1222
|
+
}
|
|
1223
|
+
],
|
|
1224
|
+
"docs": "Network SSID to share via QR code on Android.\nWhen omitted, the system uses the currently connected network when possible.",
|
|
1225
|
+
"complexTypes": [],
|
|
1226
|
+
"type": "string | undefined"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"name": "password",
|
|
1230
|
+
"tags": [
|
|
1231
|
+
{
|
|
1232
|
+
"text": "8.4.0",
|
|
1233
|
+
"name": "since"
|
|
1234
|
+
}
|
|
1235
|
+
],
|
|
1236
|
+
"docs": "Network password for QR code sharing on Android.\nRequired when sharing a specific WPA/WPA2/WPA3 network via QR code.\niOS does not allow reading saved Wi-Fi passwords from the system.",
|
|
1237
|
+
"complexTypes": [],
|
|
1238
|
+
"type": "string | undefined"
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
"name": "bluetoothIdentifier",
|
|
1242
|
+
"tags": [
|
|
1243
|
+
{
|
|
1244
|
+
"text": "8.4.0",
|
|
1245
|
+
"name": "since"
|
|
1246
|
+
}
|
|
1247
|
+
],
|
|
1248
|
+
"docs": "iOS 26.2+: Bluetooth identifier of a paired AccessorySetupKit accessory.\nRequired for Wi-Fi Infrastructure network sharing on iOS unless `accessoryIdentifier` is set.",
|
|
1249
|
+
"complexTypes": [],
|
|
1250
|
+
"type": "string | undefined"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"name": "accessoryIdentifier",
|
|
1254
|
+
"tags": [
|
|
1255
|
+
{
|
|
1256
|
+
"text": "8.4.0",
|
|
1257
|
+
"name": "since"
|
|
1258
|
+
}
|
|
1259
|
+
],
|
|
1260
|
+
"docs": "iOS 26.2+: Accessory UUID from AccessorySetupKit.\nAlternative lookup key when `bluetoothIdentifier` is unavailable.",
|
|
1261
|
+
"complexTypes": [],
|
|
1262
|
+
"type": "string | undefined"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"name": "requestAuthorization",
|
|
1266
|
+
"tags": [
|
|
1267
|
+
{
|
|
1268
|
+
"text": "8.4.0",
|
|
1269
|
+
"name": "since"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"text": "false",
|
|
1273
|
+
"name": "default"
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
1276
|
+
"docs": "iOS 26.2+: Request initial Wi-Fi network sharing authorization for the accessory.",
|
|
1277
|
+
"complexTypes": [],
|
|
1278
|
+
"type": "boolean | undefined"
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"name": "askToShare",
|
|
1282
|
+
"tags": [
|
|
1283
|
+
{
|
|
1284
|
+
"text": "8.4.0",
|
|
1285
|
+
"name": "since"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
"text": "true",
|
|
1289
|
+
"name": "default"
|
|
1290
|
+
}
|
|
1291
|
+
],
|
|
1292
|
+
"docs": "iOS 26.2+: Prompt the user to share the current Wi-Fi network with the accessory.",
|
|
1293
|
+
"complexTypes": [],
|
|
1294
|
+
"type": "boolean | undefined"
|
|
1295
|
+
}
|
|
1296
|
+
]
|
|
1097
1297
|
}
|
|
1098
1298
|
],
|
|
1099
1299
|
"enums": [
|
|
@@ -1248,6 +1448,56 @@
|
|
|
1248
1448
|
"complexTypes": []
|
|
1249
1449
|
}
|
|
1250
1450
|
]
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "WifiSharingAuthorizationState",
|
|
1454
|
+
"slug": "wifisharingauthorizationstate",
|
|
1455
|
+
"docs": "Authorization state returned by iOS Wi-Fi Infrastructure sharing",
|
|
1456
|
+
"types": [
|
|
1457
|
+
{
|
|
1458
|
+
"text": "'authorized'",
|
|
1459
|
+
"complexTypes": []
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
"text": "'denied'",
|
|
1463
|
+
"complexTypes": []
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"text": "'notDetermined'",
|
|
1467
|
+
"complexTypes": []
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
"text": "'unsupported'",
|
|
1471
|
+
"complexTypes": []
|
|
1472
|
+
}
|
|
1473
|
+
]
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
"name": "WifiSharingAskState",
|
|
1477
|
+
"slug": "wifisharingaskstate",
|
|
1478
|
+
"docs": "Result state returned by iOS Wi-Fi Infrastructure askToShare()",
|
|
1479
|
+
"types": [
|
|
1480
|
+
{
|
|
1481
|
+
"text": "'shared'",
|
|
1482
|
+
"complexTypes": []
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
"text": "'declined'",
|
|
1486
|
+
"complexTypes": []
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
"text": "'cancelled'",
|
|
1490
|
+
"complexTypes": []
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
"text": "'notNeeded'",
|
|
1494
|
+
"complexTypes": []
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
"text": "'unsupported'",
|
|
1498
|
+
"complexTypes": []
|
|
1499
|
+
}
|
|
1500
|
+
]
|
|
1251
1501
|
}
|
|
1252
1502
|
],
|
|
1253
1503
|
"pluginConfigs": []
|
|
@@ -253,6 +253,38 @@ export interface CapacitorWifiPlugin {
|
|
|
253
253
|
* ```
|
|
254
254
|
*/
|
|
255
255
|
isNetworkSaved(options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;
|
|
256
|
+
/**
|
|
257
|
+
* Share Wi-Fi network credentials using platform-native sharing flows.
|
|
258
|
+
*
|
|
259
|
+
* On Android 10+, this uses Wi-Fi Easy Connect (DPP). When `dppUri` is provided, the system
|
|
260
|
+
* provisions credentials to the target device. Otherwise, it opens the system UI to share the
|
|
261
|
+
* current or specified network (optionally via QR code when `ssid` and `password` are provided).
|
|
262
|
+
*
|
|
263
|
+
* On iOS 26.2+, this uses the Wi-Fi Infrastructure framework with a paired AccessorySetupKit
|
|
264
|
+
* accessory. The host app must pair the accessory first and pass its `bluetoothIdentifier` or
|
|
265
|
+
* `accessoryIdentifier`. The app also needs the `com.apple.developer.wifi-infrastructure` entitlement.
|
|
266
|
+
*
|
|
267
|
+
* @param options - Sharing options
|
|
268
|
+
* @returns Promise that resolves when the sharing flow starts or completes
|
|
269
|
+
* @throws Error if sharing is unavailable or fails
|
|
270
|
+
* @since 8.4.0
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* // Android: provision credentials to an IoT device via DPP URI
|
|
274
|
+
* await CapacitorWifi.shareNetwork({ dppUri: 'DPP:...' });
|
|
275
|
+
*
|
|
276
|
+
* // Android: show system UI to share the current network
|
|
277
|
+
* await CapacitorWifi.shareNetwork();
|
|
278
|
+
*
|
|
279
|
+
* // iOS: share with a paired Bluetooth accessory
|
|
280
|
+
* await CapacitorWifi.shareNetwork({
|
|
281
|
+
* bluetoothIdentifier: accessory.bluetoothIdentifier,
|
|
282
|
+
* requestAuthorization: true,
|
|
283
|
+
* askToShare: true,
|
|
284
|
+
* });
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
shareNetwork(options?: ShareNetworkOptions): Promise<ShareNetworkResult>;
|
|
256
288
|
/**
|
|
257
289
|
* Get the native plugin version.
|
|
258
290
|
*
|
|
@@ -619,3 +651,97 @@ export interface IsNetworkSavedResult {
|
|
|
619
651
|
*/
|
|
620
652
|
isSaved: boolean;
|
|
621
653
|
}
|
|
654
|
+
/**
|
|
655
|
+
* Options for sharing Wi-Fi network credentials
|
|
656
|
+
*
|
|
657
|
+
* @since 8.4.0
|
|
658
|
+
*/
|
|
659
|
+
export interface ShareNetworkOptions {
|
|
660
|
+
/**
|
|
661
|
+
* Android: Wi-Fi Easy Connect (DPP) URI from the target device.
|
|
662
|
+
* When provided, launches the system UI to provision Wi-Fi credentials to that device.
|
|
663
|
+
*
|
|
664
|
+
* @since 8.4.0
|
|
665
|
+
*/
|
|
666
|
+
dppUri?: string;
|
|
667
|
+
/**
|
|
668
|
+
* Network SSID to share via QR code on Android.
|
|
669
|
+
* When omitted, the system uses the currently connected network when possible.
|
|
670
|
+
*
|
|
671
|
+
* @since 8.4.0
|
|
672
|
+
*/
|
|
673
|
+
ssid?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Network password for QR code sharing on Android.
|
|
676
|
+
* Required when sharing a specific WPA/WPA2/WPA3 network via QR code.
|
|
677
|
+
* iOS does not allow reading saved Wi-Fi passwords from the system.
|
|
678
|
+
*
|
|
679
|
+
* @since 8.4.0
|
|
680
|
+
*/
|
|
681
|
+
password?: string;
|
|
682
|
+
/**
|
|
683
|
+
* iOS 26.2+: Bluetooth identifier of a paired AccessorySetupKit accessory.
|
|
684
|
+
* Required for Wi-Fi Infrastructure network sharing on iOS unless `accessoryIdentifier` is set.
|
|
685
|
+
*
|
|
686
|
+
* @since 8.4.0
|
|
687
|
+
*/
|
|
688
|
+
bluetoothIdentifier?: string;
|
|
689
|
+
/**
|
|
690
|
+
* iOS 26.2+: Accessory UUID from AccessorySetupKit.
|
|
691
|
+
* Alternative lookup key when `bluetoothIdentifier` is unavailable.
|
|
692
|
+
*
|
|
693
|
+
* @since 8.4.0
|
|
694
|
+
*/
|
|
695
|
+
accessoryIdentifier?: string;
|
|
696
|
+
/**
|
|
697
|
+
* iOS 26.2+: Request initial Wi-Fi network sharing authorization for the accessory.
|
|
698
|
+
*
|
|
699
|
+
* @since 8.4.0
|
|
700
|
+
* @default false
|
|
701
|
+
*/
|
|
702
|
+
requestAuthorization?: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* iOS 26.2+: Prompt the user to share the current Wi-Fi network with the accessory.
|
|
705
|
+
*
|
|
706
|
+
* @since 8.4.0
|
|
707
|
+
* @default true
|
|
708
|
+
*/
|
|
709
|
+
askToShare?: boolean;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Authorization state returned by iOS Wi-Fi Infrastructure sharing
|
|
713
|
+
*
|
|
714
|
+
* @since 8.4.0
|
|
715
|
+
*/
|
|
716
|
+
export type WifiSharingAuthorizationState = 'authorized' | 'denied' | 'notDetermined' | 'unsupported';
|
|
717
|
+
/**
|
|
718
|
+
* Result state returned by iOS Wi-Fi Infrastructure askToShare()
|
|
719
|
+
*
|
|
720
|
+
* @since 8.4.0
|
|
721
|
+
*/
|
|
722
|
+
export type WifiSharingAskState = 'shared' | 'declined' | 'cancelled' | 'notNeeded' | 'unsupported';
|
|
723
|
+
/**
|
|
724
|
+
* Result from shareNetwork()
|
|
725
|
+
*
|
|
726
|
+
* @since 8.4.0
|
|
727
|
+
*/
|
|
728
|
+
export interface ShareNetworkResult {
|
|
729
|
+
/**
|
|
730
|
+
* Whether the platform sharing flow was started or completed.
|
|
731
|
+
*
|
|
732
|
+
* @since 8.4.0
|
|
733
|
+
*/
|
|
734
|
+
started: boolean;
|
|
735
|
+
/**
|
|
736
|
+
* iOS: Authorization state after `requestAuthorization`, when requested.
|
|
737
|
+
*
|
|
738
|
+
* @since 8.4.0
|
|
739
|
+
*/
|
|
740
|
+
authorizationState?: WifiSharingAuthorizationState;
|
|
741
|
+
/**
|
|
742
|
+
* iOS: Result of `askToShare` when requested.
|
|
743
|
+
*
|
|
744
|
+
* @since 8.4.0
|
|
745
|
+
*/
|
|
746
|
+
askToShareState?: WifiSharingAskState;
|
|
747
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAmjBA;;;;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 * Check whether a network with the given SSID has already been saved/configured by this app.\n * On Android SDK 30+, this checks the app's Wi-Fi network suggestions.\n * On older Android (including SDK 29), this checks the system's configured networks list.\n * On iOS, this checks the hotspot configurations managed by this app.\n * Use this to decide whether to call addNetwork() (first time) or connect() (already saved).\n *\n * @param options - Options containing the SSID to check\n * @returns Promise that resolves with whether the network is saved\n * @throws Error if the check fails\n * @since 8.2.0\n * @example\n * ```typescript\n * const { isSaved } = await CapacitorWifi.isNetworkSaved({ ssid: 'MyNetwork' });\n * if (isSaved) {\n * await CapacitorWifi.connect({ ssid: 'MyNetwork', password: 'mypassword' });\n * } else {\n * await CapacitorWifi.addNetwork({ ssid: 'MyNetwork', password: 'mypassword' });\n * }\n * ```\n */\n isNetworkSaved(options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;\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\n/**\n * Options for checking whether a network is saved\n *\n * @since 8.2.0\n */\nexport interface IsNetworkSavedOptions {\n /**\n * The SSID of the network to check\n *\n * @since 8.2.0\n */\n ssid: string;\n}\n\n/**\n * Result from isNetworkSaved()\n *\n * @since 8.2.0\n */\nexport interface IsNetworkSavedResult {\n /**\n * Whether the network has already been saved/configured by this app\n *\n * @since 8.2.0\n */\n isSaved: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAolBA;;;;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 * Check whether a network with the given SSID has already been saved/configured by this app.\n * On Android SDK 30+, this checks the app's Wi-Fi network suggestions.\n * On older Android (including SDK 29), this checks the system's configured networks list.\n * On iOS, this checks the hotspot configurations managed by this app.\n * Use this to decide whether to call addNetwork() (first time) or connect() (already saved).\n *\n * @param options - Options containing the SSID to check\n * @returns Promise that resolves with whether the network is saved\n * @throws Error if the check fails\n * @since 8.2.0\n * @example\n * ```typescript\n * const { isSaved } = await CapacitorWifi.isNetworkSaved({ ssid: 'MyNetwork' });\n * if (isSaved) {\n * await CapacitorWifi.connect({ ssid: 'MyNetwork', password: 'mypassword' });\n * } else {\n * await CapacitorWifi.addNetwork({ ssid: 'MyNetwork', password: 'mypassword' });\n * }\n * ```\n */\n isNetworkSaved(options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;\n\n /**\n * Share Wi-Fi network credentials using platform-native sharing flows.\n *\n * On Android 10+, this uses Wi-Fi Easy Connect (DPP). When `dppUri` is provided, the system\n * provisions credentials to the target device. Otherwise, it opens the system UI to share the\n * current or specified network (optionally via QR code when `ssid` and `password` are provided).\n *\n * On iOS 26.2+, this uses the Wi-Fi Infrastructure framework with a paired AccessorySetupKit\n * accessory. The host app must pair the accessory first and pass its `bluetoothIdentifier` or\n * `accessoryIdentifier`. The app also needs the `com.apple.developer.wifi-infrastructure` entitlement.\n *\n * @param options - Sharing options\n * @returns Promise that resolves when the sharing flow starts or completes\n * @throws Error if sharing is unavailable or fails\n * @since 8.4.0\n * @example\n * ```typescript\n * // Android: provision credentials to an IoT device via DPP URI\n * await CapacitorWifi.shareNetwork({ dppUri: 'DPP:...' });\n *\n * // Android: show system UI to share the current network\n * await CapacitorWifi.shareNetwork();\n *\n * // iOS: share with a paired Bluetooth accessory\n * await CapacitorWifi.shareNetwork({\n * bluetoothIdentifier: accessory.bluetoothIdentifier,\n * requestAuthorization: true,\n * askToShare: true,\n * });\n * ```\n */\n shareNetwork(options?: ShareNetworkOptions): Promise<ShareNetworkResult>;\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\n/**\n * Options for checking whether a network is saved\n *\n * @since 8.2.0\n */\nexport interface IsNetworkSavedOptions {\n /**\n * The SSID of the network to check\n *\n * @since 8.2.0\n */\n ssid: string;\n}\n\n/**\n * Result from isNetworkSaved()\n *\n * @since 8.2.0\n */\nexport interface IsNetworkSavedResult {\n /**\n * Whether the network has already been saved/configured by this app\n *\n * @since 8.2.0\n */\n isSaved: boolean;\n}\n\n/**\n * Options for sharing Wi-Fi network credentials\n *\n * @since 8.4.0\n */\nexport interface ShareNetworkOptions {\n /**\n * Android: Wi-Fi Easy Connect (DPP) URI from the target device.\n * When provided, launches the system UI to provision Wi-Fi credentials to that device.\n *\n * @since 8.4.0\n */\n dppUri?: string;\n\n /**\n * Network SSID to share via QR code on Android.\n * When omitted, the system uses the currently connected network when possible.\n *\n * @since 8.4.0\n */\n ssid?: string;\n\n /**\n * Network password for QR code sharing on Android.\n * Required when sharing a specific WPA/WPA2/WPA3 network via QR code.\n * iOS does not allow reading saved Wi-Fi passwords from the system.\n *\n * @since 8.4.0\n */\n password?: string;\n\n /**\n * iOS 26.2+: Bluetooth identifier of a paired AccessorySetupKit accessory.\n * Required for Wi-Fi Infrastructure network sharing on iOS unless `accessoryIdentifier` is set.\n *\n * @since 8.4.0\n */\n bluetoothIdentifier?: string;\n\n /**\n * iOS 26.2+: Accessory UUID from AccessorySetupKit.\n * Alternative lookup key when `bluetoothIdentifier` is unavailable.\n *\n * @since 8.4.0\n */\n accessoryIdentifier?: string;\n\n /**\n * iOS 26.2+: Request initial Wi-Fi network sharing authorization for the accessory.\n *\n * @since 8.4.0\n * @default false\n */\n requestAuthorization?: boolean;\n\n /**\n * iOS 26.2+: Prompt the user to share the current Wi-Fi network with the accessory.\n *\n * @since 8.4.0\n * @default true\n */\n askToShare?: boolean;\n}\n\n/**\n * Authorization state returned by iOS Wi-Fi Infrastructure sharing\n *\n * @since 8.4.0\n */\nexport type WifiSharingAuthorizationState = 'authorized' | 'denied' | 'notDetermined' | 'unsupported';\n\n/**\n * Result state returned by iOS Wi-Fi Infrastructure askToShare()\n *\n * @since 8.4.0\n */\nexport type WifiSharingAskState = 'shared' | 'declined' | 'cancelled' | 'notNeeded' | 'unsupported';\n\n/**\n * Result from shareNetwork()\n *\n * @since 8.4.0\n */\nexport interface ShareNetworkResult {\n /**\n * Whether the platform sharing flow was started or completed.\n *\n * @since 8.4.0\n */\n started: boolean;\n\n /**\n * iOS: Authorization state after `requestAuthorization`, when requested.\n *\n * @since 8.4.0\n */\n authorizationState?: WifiSharingAuthorizationState;\n\n /**\n * iOS: Result of `askToShare` when requested.\n *\n * @since 8.4.0\n */\n askToShareState?: WifiSharingAskState;\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, IsNetworkSavedOptions, IsNetworkSavedResult, PermissionStatus, RequestPermissionsOptions, WifiInfo } from './definitions';
|
|
2
|
+
import type { AddNetworkOptions, CapacitorWifiPlugin, ConnectOptions, DisconnectOptions, GetAvailableNetworksResult, GetIpAddressResult, GetRssiResult, GetSsidResult, IsEnabledResult, IsNetworkSavedOptions, IsNetworkSavedResult, PermissionStatus, RequestPermissionsOptions, ShareNetworkOptions, ShareNetworkResult, 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>;
|
|
@@ -14,6 +14,7 @@ export declare class CapacitorWifiWeb extends WebPlugin implements CapacitorWifi
|
|
|
14
14
|
checkPermissions(): Promise<PermissionStatus>;
|
|
15
15
|
requestPermissions(_options?: RequestPermissionsOptions): Promise<PermissionStatus>;
|
|
16
16
|
isNetworkSaved(_options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;
|
|
17
|
+
shareNetwork(_options?: ShareNetworkOptions): Promise<ShareNetworkResult>;
|
|
17
18
|
getPluginVersion(): Promise<{
|
|
18
19
|
version: string;
|
|
19
20
|
}>;
|
package/dist/esm/web.js
CHANGED
|
@@ -39,6 +39,9 @@ export class CapacitorWifiWeb extends WebPlugin {
|
|
|
39
39
|
async isNetworkSaved(_options) {
|
|
40
40
|
throw this.unimplemented('Not implemented on web.');
|
|
41
41
|
}
|
|
42
|
+
async shareNetwork(_options) {
|
|
43
|
+
throw this.unimplemented('Not implemented on web.');
|
|
44
|
+
}
|
|
42
45
|
async getPluginVersion() {
|
|
43
46
|
return { version: '1.0.0' };
|
|
44
47
|
}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqB5C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C,KAAK,CAAC,UAAU,CAAC,QAA2B;QAC1C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAwB;QACpC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA4B;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAoC;QAC3D,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,QAA+B;QAClD,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA8B;QAC/C,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 IsNetworkSavedOptions,\n IsNetworkSavedResult,\n PermissionStatus,\n RequestPermissionsOptions,\n ShareNetworkOptions,\n ShareNetworkResult,\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 isNetworkSaved(_options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async shareNetwork(_options?: ShareNetworkOptions): Promise<ShareNetworkResult> {\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
|
@@ -121,6 +121,9 @@ class CapacitorWifiWeb extends core.WebPlugin {
|
|
|
121
121
|
async isNetworkSaved(_options) {
|
|
122
122
|
throw this.unimplemented('Not implemented on web.');
|
|
123
123
|
}
|
|
124
|
+
async shareNetwork(_options) {
|
|
125
|
+
throw this.unimplemented('Not implemented on web.');
|
|
126
|
+
}
|
|
124
127
|
async getPluginVersion() {
|
|
125
128
|
return { version: '1.0.0' };
|
|
126
129
|
}
|
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 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 isNetworkSaved(_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,GAA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,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,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 isNetworkSaved(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async shareNetwork(_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,CAA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,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,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,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
|
@@ -120,6 +120,9 @@ var capacitorCapgoWifi = (function (exports, core) {
|
|
|
120
120
|
async isNetworkSaved(_options) {
|
|
121
121
|
throw this.unimplemented('Not implemented on web.');
|
|
122
122
|
}
|
|
123
|
+
async shareNetwork(_options) {
|
|
124
|
+
throw this.unimplemented('Not implemented on web.');
|
|
125
|
+
}
|
|
123
126
|
async getPluginVersion() {
|
|
124
127
|
return { version: '1.0.0' };
|
|
125
128
|
}
|
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 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 isNetworkSaved(_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,mBAA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Aa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,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 isNetworkSaved(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async shareNetwork(_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;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,iBAAiB;IACvF;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB;IACvG;IACA;IACA;IACA;IACA;IACA,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;IAC3E;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;IAC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AAI,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,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,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;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import CoreLocation
|
|
|
5
5
|
|
|
6
6
|
@objc(CapacitorWifiPlugin)
|
|
7
7
|
public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelegate {
|
|
8
|
-
private let pluginVersion: String = "8.
|
|
8
|
+
private let pluginVersion: String = "8.4.0"
|
|
9
9
|
public let identifier = "CapacitorWifiPlugin"
|
|
10
10
|
public let jsName = "CapacitorWifi"
|
|
11
11
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -22,6 +22,7 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin, CLLocationManager
|
|
|
22
22
|
CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
|
|
23
23
|
CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
|
|
24
24
|
CAPPluginMethod(name: "isNetworkSaved", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "shareNetwork", returnType: CAPPluginReturnPromise),
|
|
25
26
|
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
26
27
|
]
|
|
27
28
|
|
|
@@ -240,6 +241,45 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin, CLLocationManager
|
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
|
|
244
|
+
@objc func shareNetwork(_ call: CAPPluginCall) {
|
|
245
|
+
if #available(iOS 26.2, *) {
|
|
246
|
+
#if canImport(AccessorySetupKit) && canImport(WiFiInfrastructure)
|
|
247
|
+
let bluetoothIdentifier = call.getString("bluetoothIdentifier")
|
|
248
|
+
let accessoryIdentifier = call.getString("accessoryIdentifier")
|
|
249
|
+
let requestAuthorization = call.getBool("requestAuthorization") ?? false
|
|
250
|
+
let askToShare = call.getBool("askToShare") ?? true
|
|
251
|
+
|
|
252
|
+
Task {
|
|
253
|
+
do {
|
|
254
|
+
let response = try await WifiNetworkSharingHelper.shareNetwork(
|
|
255
|
+
WifiNetworkSharingHelper.ShareRequest(
|
|
256
|
+
bluetoothIdentifier: bluetoothIdentifier,
|
|
257
|
+
accessoryIdentifier: accessoryIdentifier,
|
|
258
|
+
requestAuthorization: requestAuthorization,
|
|
259
|
+
askToShare: askToShare
|
|
260
|
+
)
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
var result = JSObject()
|
|
264
|
+
result["started"] = response.started
|
|
265
|
+
if let authorizationState = response.authorizationState {
|
|
266
|
+
result["authorizationState"] = authorizationState
|
|
267
|
+
}
|
|
268
|
+
if let askToShareState = response.askToShareState {
|
|
269
|
+
result["askToShareState"] = askToShareState
|
|
270
|
+
}
|
|
271
|
+
call.resolve(result)
|
|
272
|
+
} catch {
|
|
273
|
+
call.reject(error.localizedDescription, nil, error)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return
|
|
277
|
+
#endif
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
call.reject("Wi-Fi Infrastructure sharing requires iOS 26.2 or later.")
|
|
281
|
+
}
|
|
282
|
+
|
|
243
283
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
244
284
|
call.resolve(["version": self.pluginVersion])
|
|
245
285
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
#if canImport(AccessorySetupKit) && canImport(WiFiInfrastructure)
|
|
4
|
+
import AccessorySetupKit
|
|
5
|
+
import WiFiInfrastructure
|
|
6
|
+
|
|
7
|
+
@available(iOS 26.2, *)
|
|
8
|
+
enum WifiNetworkSharingHelper {
|
|
9
|
+
struct ShareRequest {
|
|
10
|
+
let bluetoothIdentifier: String?
|
|
11
|
+
let accessoryIdentifier: String?
|
|
12
|
+
let requestAuthorization: Bool
|
|
13
|
+
let askToShare: Bool
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
struct ShareResponse {
|
|
17
|
+
var started = false
|
|
18
|
+
var authorizationState: String?
|
|
19
|
+
var askToShareState: String?
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static func shareNetwork(_ request: ShareRequest) async throws -> ShareResponse {
|
|
23
|
+
let accessory = try await findAccessory(
|
|
24
|
+
bluetoothIdentifier: request.bluetoothIdentifier,
|
|
25
|
+
accessoryIdentifier: request.accessoryIdentifier
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
let controller = try await WINetworkSharingController(for: accessory)
|
|
29
|
+
var response = ShareResponse()
|
|
30
|
+
|
|
31
|
+
if request.requestAuthorization {
|
|
32
|
+
let state = try await controller.requestAuthorization()
|
|
33
|
+
response.authorizationState = mapAuthorizationState(state)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if request.askToShare {
|
|
37
|
+
let state = try await controller.askToShare()
|
|
38
|
+
response.askToShareState = mapAskToShareState(state)
|
|
39
|
+
response.started = true
|
|
40
|
+
} else if request.requestAuthorization {
|
|
41
|
+
response.started = true
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return response
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private static func findAccessory(
|
|
48
|
+
bluetoothIdentifier: String?,
|
|
49
|
+
accessoryIdentifier: String?
|
|
50
|
+
) async throws -> ASAccessory {
|
|
51
|
+
guard bluetoothIdentifier != nil || accessoryIdentifier != nil else {
|
|
52
|
+
throw WifiNetworkSharingError.missingAccessoryIdentifier
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let session = ASAccessorySession()
|
|
56
|
+
let accessories = try await activateAndFetchAccessories(session: session)
|
|
57
|
+
defer { session.invalidate() }
|
|
58
|
+
|
|
59
|
+
if let bluetoothIdentifier,
|
|
60
|
+
let accessory = accessories.first(where: { matchesIdentifier($0, identifier: bluetoothIdentifier) }) {
|
|
61
|
+
return accessory
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if let accessoryIdentifier,
|
|
65
|
+
let accessory = accessories.first(where: { matchesIdentifier($0, identifier: accessoryIdentifier) }) {
|
|
66
|
+
return accessory
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
throw WifiNetworkSharingError.accessoryNotFound
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private static func matchesIdentifier(_ accessory: ASAccessory, identifier: String) -> Bool {
|
|
73
|
+
if let bluetoothIdentifier = accessory.bluetoothIdentifier?.uuidString,
|
|
74
|
+
bluetoothIdentifier.caseInsensitiveCompare(identifier) == .orderedSame {
|
|
75
|
+
return true
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return accessory.displayName == identifier
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private static func activateAndFetchAccessories(session: ASAccessorySession) async throws -> [ASAccessory] {
|
|
82
|
+
try await withCheckedThrowingContinuation { continuation in
|
|
83
|
+
var didResume = false
|
|
84
|
+
session.activate(on: DispatchQueue.main) { event in
|
|
85
|
+
guard !didResume else { return }
|
|
86
|
+
|
|
87
|
+
switch event.eventType {
|
|
88
|
+
case .activated:
|
|
89
|
+
didResume = true
|
|
90
|
+
continuation.resume(returning: session.accessories)
|
|
91
|
+
case .accessoryAdded, .accessoryChanged:
|
|
92
|
+
if !session.accessories.isEmpty {
|
|
93
|
+
didResume = true
|
|
94
|
+
continuation.resume(returning: session.accessories)
|
|
95
|
+
}
|
|
96
|
+
default:
|
|
97
|
+
break
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private static func mapAuthorizationState(_ state: WINetworkSharingController.AuthorizationState) -> String {
|
|
104
|
+
switch state {
|
|
105
|
+
case .automatic, .askToShare:
|
|
106
|
+
return "authorized"
|
|
107
|
+
case .denied:
|
|
108
|
+
return "denied"
|
|
109
|
+
case .undetermined:
|
|
110
|
+
return "notDetermined"
|
|
111
|
+
@unknown default:
|
|
112
|
+
return "unsupported"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private static func mapAskToShareState(_ state: WINetworkSharingAskToShareState) -> String {
|
|
117
|
+
switch state {
|
|
118
|
+
case .approved:
|
|
119
|
+
return "shared"
|
|
120
|
+
case .denied:
|
|
121
|
+
return "declined"
|
|
122
|
+
case .undetermined:
|
|
123
|
+
return "unsupported"
|
|
124
|
+
@unknown default:
|
|
125
|
+
return "unsupported"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
enum WifiNetworkSharingError: LocalizedError {
|
|
131
|
+
case unsupported
|
|
132
|
+
case missingAccessoryIdentifier
|
|
133
|
+
case accessoryNotFound
|
|
134
|
+
|
|
135
|
+
var errorDescription: String? {
|
|
136
|
+
switch self {
|
|
137
|
+
case .unsupported:
|
|
138
|
+
return "Wi-Fi Infrastructure sharing requires iOS 26.2 or later with AccessorySetupKit and the Wi-Fi Infrastructure entitlement."
|
|
139
|
+
case .missingAccessoryIdentifier:
|
|
140
|
+
return "bluetoothIdentifier or accessoryIdentifier is required for iOS Wi-Fi sharing."
|
|
141
|
+
case .accessoryNotFound:
|
|
142
|
+
return "No paired AccessorySetupKit accessory matched the provided identifier."
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
#endif
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-wifi",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.0",
|
|
4
4
|
"description": "Manage WiFi connectivity for your Capacitor app",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -50,8 +50,7 @@
|
|
|
50
50
|
"prepublishOnly": "bun run build",
|
|
51
51
|
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
|
|
52
52
|
"example:install": "cd example-app && bun install --frozen-lockfile",
|
|
53
|
-
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
|
|
54
|
-
"example:capgo:deploy": "bun run example:build && bun scripts/deploy-example-capgo.mjs"
|
|
53
|
+
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
56
|
"@capacitor/android": "^8.0.0",
|