@capgo/capacitor-wifi 8.1.10 → 8.2.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 CHANGED
@@ -65,6 +65,7 @@ npx cap sync
65
65
  * [`requestPermissions(...)`](#requestpermissions)
66
66
  * [`addListener('networksScanned', ...)`](#addlistenernetworksscanned-)
67
67
  * [`removeAllListeners()`](#removealllisteners)
68
+ * [`isNetworkSaved(...)`](#isnetworksaved)
68
69
  * [`getPluginVersion()`](#getpluginversion)
69
70
  * [Interfaces](#interfaces)
70
71
  * [Type Aliases](#type-aliases)
@@ -320,6 +321,29 @@ Remove all listeners for this plugin.
320
321
  --------------------
321
322
 
322
323
 
324
+ ### isNetworkSaved(...)
325
+
326
+ ```typescript
327
+ isNetworkSaved(options: IsNetworkSavedOptions) => Promise<IsNetworkSavedResult>
328
+ ```
329
+
330
+ Check whether a network with the given SSID has already been saved/configured by this app.
331
+ On Android SDK 30+, this checks the app's Wi-Fi network suggestions.
332
+ On older Android (including SDK 29), this checks the system's configured networks list.
333
+ On iOS, this checks the hotspot configurations managed by this app.
334
+ Use this to decide whether to call addNetwork() (first time) or connect() (already saved).
335
+
336
+ | Param | Type | Description |
337
+ | ------------- | ----------------------------------------------------------------------- | -------------------------------------- |
338
+ | **`options`** | <code><a href="#isnetworksavedoptions">IsNetworkSavedOptions</a></code> | - Options containing the SSID to check |
339
+
340
+ **Returns:** <code>Promise&lt;<a href="#isnetworksavedresult">IsNetworkSavedResult</a>&gt;</code>
341
+
342
+ **Since:** 8.2.0
343
+
344
+ --------------------
345
+
346
+
323
347
  ### getPluginVersion()
324
348
 
325
349
  ```typescript
@@ -466,6 +490,24 @@ Options for requesting permissions
466
490
  | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
467
491
 
468
492
 
493
+ #### IsNetworkSavedResult
494
+
495
+ Result from isNetworkSaved()
496
+
497
+ | Prop | Type | Description | Since |
498
+ | ------------- | -------------------- | ----------------------------------------------------------------- | ----- |
499
+ | **`isSaved`** | <code>boolean</code> | Whether the network has already been saved/configured by this app | 8.2.0 |
500
+
501
+
502
+ #### IsNetworkSavedOptions
503
+
504
+ Options for checking whether a network is saved
505
+
506
+ | Prop | Type | Description | Since |
507
+ | ---------- | ------------------- | -------------------------------- | ----- |
508
+ | **`ssid`** | <code>string</code> | The SSID of the network to check | 8.2.0 |
509
+
510
+
469
511
  ### Type Aliases
470
512
 
471
513
 
@@ -44,7 +44,7 @@ import java.util.List;
44
44
  )
45
45
  public class CapacitorWifiPlugin extends Plugin {
46
46
 
47
- private final String pluginVersion = "8.1.10";
47
+ private final String pluginVersion = "8.2.0";
48
48
 
49
49
  private WifiManager wifiManager;
50
50
  private ConnectivityManager connectivityManager;
@@ -641,6 +641,65 @@ public class CapacitorWifiPlugin extends Plugin {
641
641
  }
642
642
  }
643
643
 
644
+ @PluginMethod
645
+ public void isNetworkSaved(PluginCall call) {
646
+ String ssid = call.getString("ssid");
647
+ if (ssid == null || ssid.isEmpty()) {
648
+ call.reject("SSID is required");
649
+ return;
650
+ }
651
+
652
+ try {
653
+ boolean isSaved;
654
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
655
+ isSaved = isNetworkSavedModern(ssid);
656
+ } else {
657
+ // API 29 (Q): getNetworkSuggestions() isn't available yet, fall back to the
658
+ // legacy WifiConfiguration-based lookup which works on API 28 and API 29.
659
+ isSaved = isNetworkSavedLegacy(ssid);
660
+ }
661
+ JSObject ret = new JSObject();
662
+ ret.put("isSaved", isSaved);
663
+ call.resolve(ret);
664
+ } catch (Exception e) {
665
+ call.reject("Failed to check network saved status: " + e.getMessage(), e);
666
+ }
667
+ }
668
+
669
+ @RequiresApi(api = Build.VERSION_CODES.R)
670
+ private boolean isNetworkSavedModern(String ssid) {
671
+ List<WifiNetworkSuggestion> suggestions = wifiManager.getNetworkSuggestions();
672
+ for (WifiNetworkSuggestion suggestion : suggestions) {
673
+ // getSsid() returns the raw (unquoted) SSID; strip quotes defensively in case the
674
+ // platform ever returns a quoted value.
675
+ String suggestionSsid = suggestion.getSsid();
676
+ if (suggestionSsid != null) {
677
+ suggestionSsid = suggestionSsid.replace("\"", "");
678
+ }
679
+ if (ssid.equals(suggestionSsid)) {
680
+ return true;
681
+ }
682
+ }
683
+ return false;
684
+ }
685
+
686
+ @SuppressWarnings("deprecation")
687
+ private boolean isNetworkSavedLegacy(String ssid) {
688
+ List<WifiConfiguration> configs = wifiManager.getConfiguredNetworks();
689
+ if (configs == null) {
690
+ // getConfiguredNetworks() can return null when the caller lacks ACCESS_WIFI_STATE
691
+ // permission or Wi-Fi is disabled; treat this as an indeterminate state.
692
+ throw new IllegalStateException("Unable to retrieve configured networks; check permissions and Wi-Fi state");
693
+ }
694
+ String quotedSsid = "\"" + ssid + "\"";
695
+ for (WifiConfiguration config : configs) {
696
+ if (quotedSsid.equals(config.SSID)) {
697
+ return true;
698
+ }
699
+ }
700
+ return false;
701
+ }
702
+
644
703
  @PluginMethod
645
704
  public void getPluginVersion(final PluginCall call) {
646
705
  try {
package/dist/docs.json CHANGED
@@ -464,6 +464,46 @@
464
464
  "complexTypes": [],
465
465
  "slug": "removealllisteners"
466
466
  },
467
+ {
468
+ "name": "isNetworkSaved",
469
+ "signature": "(options: IsNetworkSavedOptions) => Promise<IsNetworkSavedResult>",
470
+ "parameters": [
471
+ {
472
+ "name": "options",
473
+ "docs": "- Options containing the SSID to check",
474
+ "type": "IsNetworkSavedOptions"
475
+ }
476
+ ],
477
+ "returns": "Promise<IsNetworkSavedResult>",
478
+ "tags": [
479
+ {
480
+ "name": "param",
481
+ "text": "options - Options containing the SSID to check"
482
+ },
483
+ {
484
+ "name": "returns",
485
+ "text": "Promise that resolves with whether the network is saved"
486
+ },
487
+ {
488
+ "name": "throws",
489
+ "text": "Error if the check fails"
490
+ },
491
+ {
492
+ "name": "since",
493
+ "text": "8.2.0"
494
+ },
495
+ {
496
+ "name": "example",
497
+ "text": "```typescript\nconst { isSaved } = await CapacitorWifi.isNetworkSaved({ ssid: 'MyNetwork' });\nif (isSaved) {\n await CapacitorWifi.connect({ ssid: 'MyNetwork', password: 'mypassword' });\n} else {\n await CapacitorWifi.addNetwork({ ssid: 'MyNetwork', password: 'mypassword' });\n}\n```"
498
+ }
499
+ ],
500
+ "docs": "Check whether a network with the given SSID has already been saved/configured by this app.\nOn Android SDK 30+, this checks the app's Wi-Fi network suggestions.\nOn older Android (including SDK 29), this checks the system's configured networks list.\nOn iOS, this checks the hotspot configurations managed by this app.\nUse this to decide whether to call addNetwork() (first time) or connect() (already saved).",
501
+ "complexTypes": [
502
+ "IsNetworkSavedResult",
503
+ "IsNetworkSavedOptions"
504
+ ],
505
+ "slug": "isnetworksaved"
506
+ },
467
507
  {
468
508
  "name": "getPluginVersion",
469
509
  "signature": "() => Promise<{ version: string; }>",
@@ -1002,6 +1042,58 @@
1002
1042
  "type": "() => Promise<void>"
1003
1043
  }
1004
1044
  ]
1045
+ },
1046
+ {
1047
+ "name": "IsNetworkSavedResult",
1048
+ "slug": "isnetworksavedresult",
1049
+ "docs": "Result from isNetworkSaved()",
1050
+ "tags": [
1051
+ {
1052
+ "text": "8.2.0",
1053
+ "name": "since"
1054
+ }
1055
+ ],
1056
+ "methods": [],
1057
+ "properties": [
1058
+ {
1059
+ "name": "isSaved",
1060
+ "tags": [
1061
+ {
1062
+ "text": "8.2.0",
1063
+ "name": "since"
1064
+ }
1065
+ ],
1066
+ "docs": "Whether the network has already been saved/configured by this app",
1067
+ "complexTypes": [],
1068
+ "type": "boolean"
1069
+ }
1070
+ ]
1071
+ },
1072
+ {
1073
+ "name": "IsNetworkSavedOptions",
1074
+ "slug": "isnetworksavedoptions",
1075
+ "docs": "Options for checking whether a network is saved",
1076
+ "tags": [
1077
+ {
1078
+ "text": "8.2.0",
1079
+ "name": "since"
1080
+ }
1081
+ ],
1082
+ "methods": [],
1083
+ "properties": [
1084
+ {
1085
+ "name": "ssid",
1086
+ "tags": [
1087
+ {
1088
+ "text": "8.2.0",
1089
+ "name": "since"
1090
+ }
1091
+ ],
1092
+ "docs": "The SSID of the network to check",
1093
+ "complexTypes": [],
1094
+ "type": "string"
1095
+ }
1096
+ ]
1005
1097
  }
1006
1098
  ],
1007
1099
  "enums": [
@@ -231,6 +231,28 @@ export interface CapacitorWifiPlugin {
231
231
  * ```
232
232
  */
233
233
  removeAllListeners(): Promise<void>;
234
+ /**
235
+ * Check whether a network with the given SSID has already been saved/configured by this app.
236
+ * On Android SDK 30+, this checks the app's Wi-Fi network suggestions.
237
+ * On older Android (including SDK 29), this checks the system's configured networks list.
238
+ * On iOS, this checks the hotspot configurations managed by this app.
239
+ * Use this to decide whether to call addNetwork() (first time) or connect() (already saved).
240
+ *
241
+ * @param options - Options containing the SSID to check
242
+ * @returns Promise that resolves with whether the network is saved
243
+ * @throws Error if the check fails
244
+ * @since 8.2.0
245
+ * @example
246
+ * ```typescript
247
+ * const { isSaved } = await CapacitorWifi.isNetworkSaved({ ssid: 'MyNetwork' });
248
+ * if (isSaved) {
249
+ * await CapacitorWifi.connect({ ssid: 'MyNetwork', password: 'mypassword' });
250
+ * } else {
251
+ * await CapacitorWifi.addNetwork({ ssid: 'MyNetwork', password: 'mypassword' });
252
+ * }
253
+ * ```
254
+ */
255
+ isNetworkSaved(options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;
234
256
  /**
235
257
  * Get the native plugin version.
236
258
  *
@@ -571,3 +593,29 @@ export declare enum NetworkSecurityType {
571
593
  */
572
594
  WAPI_CERT = 10
573
595
  }
596
+ /**
597
+ * Options for checking whether a network is saved
598
+ *
599
+ * @since 8.2.0
600
+ */
601
+ export interface IsNetworkSavedOptions {
602
+ /**
603
+ * The SSID of the network to check
604
+ *
605
+ * @since 8.2.0
606
+ */
607
+ ssid: string;
608
+ }
609
+ /**
610
+ * Result from isNetworkSaved()
611
+ *
612
+ * @since 8.2.0
613
+ */
614
+ export interface IsNetworkSavedResult {
615
+ /**
616
+ * Whether the network has already been saved/configured by this app
617
+ *
618
+ * @since 8.2.0
619
+ */
620
+ isSaved: boolean;
621
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA4hBA;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBA6EX;AA7ED,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,6DAAQ,CAAA;IAER;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,mFAAmB,CAAA;IAEnB;;;;OAIG;IACH,mGAA2B,CAAA;IAE3B;;;;OAIG;IACH,uEAAa,CAAA;IAEb;;;;OAIG;IACH,2DAAO,CAAA;IAEP;;;;OAIG;IACH,qEAAY,CAAA;IAEZ;;;;OAIG;IACH,wEAAc,CAAA;AAChB,CAAC,EA7EW,mBAAmB,KAAnB,mBAAmB,QA6E9B","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * WiFi plugin for managing device WiFi connectivity\n *\n * @since 7.0.0\n */\nexport interface CapacitorWifiPlugin {\n /**\n * Show a system dialog to add a Wi-Fi network to the device.\n * On Android SDK 30+, this opens the system Wi-Fi settings with the network pre-filled.\n * On iOS, this connects to the network directly.\n *\n * @param options - Network configuration options\n * @returns Promise that resolves when the network is added\n * @throws Error if adding the network fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addNetwork({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * isHiddenSsid: false,\n * securityType: NetworkSecurityType.WPA2_PSK\n * });\n * ```\n */\n addNetwork(options: AddNetworkOptions): Promise<void>;\n\n /**\n * Connect to a Wi-Fi network.\n * On Android, this creates a temporary connection that doesn't route traffic through the network by default.\n * Set autoRouteTraffic to true to bind app traffic to the connected network (useful for local/device-hosted APs).\n * For a persistent connection on Android, use addNetwork() instead.\n * On iOS, this creates a persistent connection.\n *\n * @param options - Connection options\n * @returns Promise that resolves when connected\n * @throws Error if connection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.connect({\n * ssid: 'MyNetwork',\n * password: 'mypassword',\n * autoRouteTraffic: true // Android only: route app traffic through this network\n * });\n * ```\n */\n connect(options: ConnectOptions): Promise<void>;\n\n /**\n * Disconnect from the current Wi-Fi network.\n * On iOS, only disconnects from networks that were added via this plugin.\n *\n * @param options - Optional disconnect options\n * @returns Promise that resolves when disconnected\n * @throws Error if disconnection fails\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.disconnect();\n * ```\n */\n disconnect(options?: DisconnectOptions): Promise<void>;\n\n /**\n * Get a list of available Wi-Fi networks from the last scan.\n * Only available on Android.\n *\n * @returns Promise that resolves with the list of networks\n * @throws Error if getting networks fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * networks.forEach(network => {\n * console.log(`SSID: ${network.ssid}, Signal: ${network.rssi} dBm`);\n * });\n * ```\n */\n getAvailableNetworks(): Promise<GetAvailableNetworksResult>;\n\n /**\n * Get the device's current IP address.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the IP address\n * @throws Error if getting IP address fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ipAddress } = await CapacitorWifi.getIpAddress();\n * console.log('IP Address:', ipAddress);\n * ```\n */\n getIpAddress(): Promise<GetIpAddressResult>;\n\n /**\n * Get the received signal strength indicator (RSSI) of the current network in dBm.\n * Only available on Android.\n *\n * @returns Promise that resolves with the RSSI value\n * @throws Error if getting RSSI fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { rssi } = await CapacitorWifi.getRssi();\n * console.log('Signal strength:', rssi, 'dBm');\n * ```\n */\n getRssi(): Promise<GetRssiResult>;\n\n /**\n * Get the service set identifier (SSID) of the current network.\n * Available on both Android and iOS.\n *\n * @returns Promise that resolves with the SSID\n * @throws Error if getting SSID fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { ssid } = await CapacitorWifi.getSsid();\n * console.log('Connected to:', ssid);\n * ```\n */\n getSsid(): Promise<GetSsidResult>;\n\n /**\n * Get comprehensive information about the currently connected WiFi network.\n * This method provides detailed network information including SSID, BSSID, IP address,\n * frequency, link speed, and signal strength in a single call.\n * On iOS, some fields may not be available and will be undefined.\n *\n * @returns Promise that resolves with the WiFi information\n * @throws Error if getting WiFi info fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const info = await CapacitorWifi.getWifiInfo();\n * console.log('Network:', info.ssid);\n * console.log('BSSID:', info.bssid);\n * console.log('IP:', info.ip);\n * console.log('Frequency:', info.frequency, 'MHz');\n * console.log('Speed:', info.linkSpeed, 'Mbps');\n * console.log('Signal:', info.signalStrength);\n * ```\n */\n getWifiInfo(): Promise<WifiInfo>;\n\n /**\n * Check if Wi-Fi is enabled on the device.\n * Only available on Android.\n *\n * @returns Promise that resolves with the Wi-Fi enabled status\n * @throws Error if checking status fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * const { enabled } = await CapacitorWifi.isEnabled();\n * console.log('WiFi is', enabled ? 'enabled' : 'disabled');\n * ```\n */\n isEnabled(): Promise<IsEnabledResult>;\n\n /**\n * Start scanning for Wi-Fi networks.\n * Only available on Android.\n * Results are delivered via the 'networksScanned' event listener.\n * Note: May fail due to system throttling or hardware issues.\n *\n * @returns Promise that resolves when scan starts\n * @throws Error if scan fails or on unsupported platform\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.addListener('networksScanned', () => {\n * console.log('Scan completed');\n * });\n * await CapacitorWifi.startScan();\n * ```\n */\n startScan(): Promise<void>;\n\n /**\n * Check the current permission status for location access.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @returns Promise that resolves with the permission status\n * @throws Error if checking permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.checkPermissions();\n * console.log('Location permission:', status.location);\n * ```\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions from the user.\n * Location permission is required for Wi-Fi operations on both platforms.\n *\n * @param options - Optional permission request options\n * @returns Promise that resolves with the updated permission status\n * @throws Error if requesting permissions fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const status = await CapacitorWifi.requestPermissions();\n * if (status.location === 'granted') {\n * console.log('Permission granted');\n * }\n * ```\n */\n requestPermissions(options?: RequestPermissionsOptions): Promise<PermissionStatus>;\n\n /**\n * Add a listener for the 'networksScanned' event.\n * Only available on Android.\n * This event is fired when Wi-Fi scan results are available.\n *\n * @param eventName - The event name ('networksScanned')\n * @param listenerFunc - The callback function to execute\n * @returns Promise that resolves with a listener handle\n * @since 7.0.0\n * @example\n * ```typescript\n * const listener = await CapacitorWifi.addListener('networksScanned', async () => {\n * const { networks } = await CapacitorWifi.getAvailableNetworks();\n * console.log('Found networks:', networks);\n * });\n * ```\n */\n addListener(eventName: 'networksScanned', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @returns Promise that resolves when all listeners are removed\n * @since 7.0.0\n * @example\n * ```typescript\n * await CapacitorWifi.removeAllListeners();\n * ```\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n * @since 7.0.0\n * @example\n * ```typescript\n * const { version } = await CapacitorWifi.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n\n/**\n * Options for adding a network\n *\n * @since 7.0.0\n */\nexport interface AddNetworkOptions {\n /**\n * The SSID of the network to add\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * The security type of the network (Android only)\n *\n * @since 7.0.0\n * @default NetworkSecurityType.WPA2_PSK\n */\n securityType?: NetworkSecurityType;\n}\n\n/**\n * Options for connecting to a network\n *\n * @since 7.0.0\n */\nexport interface ConnectOptions {\n /**\n * The SSID of the network to connect to\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The password for the network (optional for open networks)\n *\n * @since 7.0.0\n */\n password?: string;\n\n /**\n * Whether the network is hidden (Android only)\n *\n * @since 7.0.0\n * @default false\n */\n isHiddenSsid?: boolean;\n\n /**\n * Whether to automatically route app traffic through the connected Wi-Fi network (Android only)\n * When enabled, it binds the app process to the connected network using ConnectivityManager.bindProcessToNetwork()\n * This is useful for connecting to local/device-hosted APs (e.g., ESP32, IoT devices) that don't have internet access.\n *\n * @since 7.0.0\n * @default false\n */\n autoRouteTraffic?: boolean;\n}\n\n/**\n * Options for disconnecting from a network\n *\n * @since 7.0.0\n */\nexport interface DisconnectOptions {\n /**\n * The SSID of the network to disconnect from (optional)\n *\n * @since 7.0.0\n */\n ssid?: string;\n}\n\n/**\n * Result from getAvailableNetworks()\n *\n * @since 7.0.0\n */\nexport interface GetAvailableNetworksResult {\n /**\n * List of available networks\n *\n * @since 7.0.0\n */\n networks: Network[];\n}\n\n/**\n * Represents a Wi-Fi network\n *\n * @since 7.0.0\n */\nexport interface Network {\n /**\n * The SSID of the network\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n\n /**\n * The security types supported by this network (Android SDK 33+ only)\n *\n * @since 7.0.0\n */\n securityTypes?: NetworkSecurityType[];\n}\n\n/**\n * Result from getIpAddress()\n *\n * @since 7.0.0\n */\nexport interface GetIpAddressResult {\n /**\n * The device's IP address\n *\n * @since 7.0.0\n */\n ipAddress: string;\n}\n\n/**\n * Result from getRssi()\n *\n * @since 7.0.0\n */\nexport interface GetRssiResult {\n /**\n * The signal strength in dBm\n *\n * @since 7.0.0\n */\n rssi: number;\n}\n\n/**\n * Result from getSsid()\n *\n * @since 7.0.0\n */\nexport interface GetSsidResult {\n /**\n * The SSID of the current network\n *\n * @since 7.0.0\n */\n ssid: string;\n}\n\n/**\n * Comprehensive WiFi information\n *\n * @since 7.0.0\n */\nexport interface WifiInfo {\n /**\n * The SSID (network name) of the current network\n *\n * @since 7.0.0\n */\n ssid: string;\n\n /**\n * The BSSID (MAC address) of the access point.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n bssid?: string;\n\n /**\n * The device's IP address on the network\n *\n * @since 7.0.0\n */\n ip: string;\n\n /**\n * The network frequency in MHz.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n frequency?: number;\n\n /**\n * The connection speed in Mbps.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n linkSpeed?: number;\n\n /**\n * The signal strength (0-100).\n * Calculated from RSSI on Android.\n * Not available on iOS.\n *\n * @since 7.0.0\n */\n signalStrength?: number;\n}\n\n/**\n * Result from isEnabled()\n *\n * @since 7.0.0\n */\nexport interface IsEnabledResult {\n /**\n * Whether Wi-Fi is enabled\n *\n * @since 7.0.0\n */\n enabled: boolean;\n}\n\n/**\n * Permission status\n *\n * @since 7.0.0\n */\nexport interface PermissionStatus {\n /**\n * Location permission state\n *\n * @since 7.0.0\n */\n location: PermissionState;\n}\n\n/**\n * Possible permission states\n *\n * @since 7.0.0\n */\nexport type PermissionState = 'granted' | 'denied' | 'prompt';\n\n/**\n * Options for requesting permissions\n *\n * @since 7.0.0\n */\nexport interface RequestPermissionsOptions {\n /**\n * Permissions to request\n *\n * @since 7.0.0\n */\n permissions?: 'location'[];\n}\n\n/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport enum NetworkSecurityType {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n OPEN = 0,\n\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n WEP = 1,\n\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n WPA2_PSK = 2,\n\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n EAP = 3,\n\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n SAE = 4,\n\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE = 5,\n\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n WPA3_ENTERPRISE_192_BIT = 6,\n\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n PASSPOINT = 7,\n\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n OWE = 8,\n\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n WAPI_PSK = 9,\n\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n WAPI_CERT = 10,\n}\n"]}
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"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { AddNetworkOptions, CapacitorWifiPlugin, ConnectOptions, DisconnectOptions, GetAvailableNetworksResult, GetIpAddressResult, GetRssiResult, GetSsidResult, IsEnabledResult, PermissionStatus, RequestPermissionsOptions, WifiInfo } from './definitions';
2
+ import type { AddNetworkOptions, CapacitorWifiPlugin, ConnectOptions, DisconnectOptions, GetAvailableNetworksResult, GetIpAddressResult, GetRssiResult, GetSsidResult, IsEnabledResult, IsNetworkSavedOptions, IsNetworkSavedResult, PermissionStatus, RequestPermissionsOptions, WifiInfo } from './definitions';
3
3
  export declare class CapacitorWifiWeb extends WebPlugin implements CapacitorWifiPlugin {
4
4
  addNetwork(_options: AddNetworkOptions): Promise<void>;
5
5
  connect(_options: ConnectOptions): Promise<void>;
@@ -13,6 +13,7 @@ export declare class CapacitorWifiWeb extends WebPlugin implements CapacitorWifi
13
13
  startScan(): Promise<void>;
14
14
  checkPermissions(): Promise<PermissionStatus>;
15
15
  requestPermissions(_options?: RequestPermissionsOptions): Promise<PermissionStatus>;
16
+ isNetworkSaved(_options: IsNetworkSavedOptions): Promise<IsNetworkSavedResult>;
16
17
  getPluginVersion(): Promise<{
17
18
  version: string;
18
19
  }>;
package/dist/esm/web.js CHANGED
@@ -36,6 +36,9 @@ export class CapacitorWifiWeb extends WebPlugin {
36
36
  async requestPermissions(_options) {
37
37
  throw this.unimplemented('Not implemented on web.');
38
38
  }
39
+ async isNetworkSaved(_options) {
40
+ throw this.unimplemented('Not implemented on web.');
41
+ }
39
42
  async getPluginVersion() {
40
43
  return { version: '1.0.0' };
41
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAiB5C,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,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AddNetworkOptions,\n CapacitorWifiPlugin,\n ConnectOptions,\n DisconnectOptions,\n GetAvailableNetworksResult,\n GetIpAddressResult,\n GetRssiResult,\n GetSsidResult,\n IsEnabledResult,\n PermissionStatus,\n RequestPermissionsOptions,\n WifiInfo,\n} from './definitions';\n\nexport class CapacitorWifiWeb extends WebPlugin implements CapacitorWifiPlugin {\n async addNetwork(_options: AddNetworkOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async connect(_options: ConnectOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async disconnect(_options?: DisconnectOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getAvailableNetworks(): Promise<GetAvailableNetworksResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getIpAddress(): Promise<GetIpAddressResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getRssi(): Promise<GetRssiResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getSsid(): Promise<GetSsidResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getWifiInfo(): Promise<WifiInfo> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isEnabled(): Promise<IsEnabledResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async startScan(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestPermissions(_options?: RequestPermissionsOptions): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: '1.0.0' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmB5C,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,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 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 getPluginVersion(): Promise<{ version: string }> {\n return { version: '1.0.0' };\n }\n}\n"]}
@@ -118,6 +118,9 @@ class CapacitorWifiWeb extends core.WebPlugin {
118
118
  async requestPermissions(_options) {
119
119
  throw this.unimplemented('Not implemented on web.');
120
120
  }
121
+ async isNetworkSaved(_options) {
122
+ throw this.unimplemented('Not implemented on web.');
123
+ }
121
124
  async getPluginVersion() {
122
125
  return { version: '1.0.0' };
123
126
  }
@@ -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 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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,YAAY,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;AACnC,IAAI;AACJ;;;;;;;;;"}
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,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,CA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ACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -117,6 +117,9 @@ var capacitorCapgoWifi = (function (exports, core) {
117
117
  async requestPermissions(_options) {
118
118
  throw this.unimplemented('Not implemented on web.');
119
119
  }
120
+ async isNetworkSaved(_options) {
121
+ throw this.unimplemented('Not implemented on web.');
122
+ }
120
123
  async getPluginVersion() {
121
124
  return { version: '1.0.0' };
122
125
  }
@@ -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 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,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AM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;IACnC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Network security types\n *\n * @since 7.0.0\n */\nexport var NetworkSecurityType;\n(function (NetworkSecurityType) {\n /**\n * Open network with no security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OPEN\"] = 0] = \"OPEN\";\n /**\n * WEP security\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WEP\"] = 1] = \"WEP\";\n /**\n * WPA/WPA2 Personal (PSK)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA2_PSK\"] = 2] = \"WPA2_PSK\";\n /**\n * WPA/WPA2/WPA3 Enterprise (EAP)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"EAP\"] = 3] = \"EAP\";\n /**\n * WPA3 Personal (SAE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"SAE\"] = 4] = \"SAE\";\n /**\n * WPA3 Enterprise\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE\"] = 5] = \"WPA3_ENTERPRISE\";\n /**\n * WPA3 Enterprise 192-bit mode\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WPA3_ENTERPRISE_192_BIT\"] = 6] = \"WPA3_ENTERPRISE_192_BIT\";\n /**\n * Passpoint network\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"PASSPOINT\"] = 7] = \"PASSPOINT\";\n /**\n * Enhanced Open (OWE)\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"OWE\"] = 8] = \"OWE\";\n /**\n * WAPI PSK\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_PSK\"] = 9] = \"WAPI_PSK\";\n /**\n * WAPI Certificate\n *\n * @since 7.0.0\n */\n NetworkSecurityType[NetworkSecurityType[\"WAPI_CERT\"] = 10] = \"WAPI_CERT\";\n})(NetworkSecurityType || (NetworkSecurityType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorWifi = registerPlugin('CapacitorWifi', {\n web: () => import('./web').then((m) => new m.CapacitorWifiWeb()),\n});\nexport * from './definitions';\nexport { CapacitorWifi };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorWifiWeb extends WebPlugin {\n async addNetwork(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async disconnect(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAvailableNetworks() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getIpAddress() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getRssi() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getSsid() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getWifiInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isEnabled() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startScan() {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async 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,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;I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,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,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;;;;;;;;;;;;;;;"}
@@ -5,7 +5,7 @@ import CoreLocation
5
5
 
6
6
  @objc(CapacitorWifiPlugin)
7
7
  public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
8
- private let pluginVersion: String = "8.1.10"
8
+ private let pluginVersion: String = "8.2.0"
9
9
  public let identifier = "CapacitorWifiPlugin"
10
10
  public let jsName = "CapacitorWifi"
11
11
  public let pluginMethods: [CAPPluginMethod] = [
@@ -21,6 +21,7 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
21
21
  CAPPluginMethod(name: "startScan", returnType: CAPPluginReturnPromise),
22
22
  CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
23
23
  CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
24
+ CAPPluginMethod(name: "isNetworkSaved", returnType: CAPPluginReturnPromise),
24
25
  CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
25
26
  ]
26
27
 
@@ -199,6 +200,22 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
199
200
  call.resolve(["location": status])
200
201
  }
201
202
 
203
+ @objc func isNetworkSaved(_ call: CAPPluginCall) {
204
+ guard let ssid = call.getString("ssid") else {
205
+ call.reject("SSID is required")
206
+ return
207
+ }
208
+
209
+ guard let manager = hotspotManager else {
210
+ call.reject("Hotspot configuration manager is unavailable")
211
+ return
212
+ }
213
+
214
+ manager.getConfiguredSSIDs { ssids in
215
+ call.resolve(["isSaved": ssids.contains(ssid)])
216
+ }
217
+ }
218
+
202
219
  @objc func getPluginVersion(_ call: CAPPluginCall) {
203
220
  call.resolve(["version": self.pluginVersion])
204
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-wifi",
3
- "version": "8.1.10",
3
+ "version": "8.2.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",