@capgo/capacitor-wifi 8.0.3 → 8.0.5

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.
@@ -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.0.3";
47
+ private final String pluginVersion = "8.0.5";
48
48
 
49
49
  private WifiManager wifiManager;
50
50
  private ConnectivityManager connectivityManager;
@@ -6,7 +6,7 @@ import CoreLocation
6
6
 
7
7
  @objc(CapacitorWifiPlugin)
8
8
  public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
9
- private let pluginVersion: String = "8.0.3"
9
+ private let pluginVersion: String = "8.0.5"
10
10
  public let identifier = "CapacitorWifiPlugin"
11
11
  public let jsName = "CapacitorWifi"
12
12
  public let pluginMethods: [CAPPluginMethod] = [
@@ -175,53 +175,23 @@ public class CapacitorWifiPlugin: CAPPlugin, CAPBridgedPlugin {
175
175
  // MARK: - Helper Methods
176
176
 
177
177
  private func getCurrentSSID() -> String? {
178
- if #available(iOS 14.0, *) {
179
- var currentSSID: String?
180
- NEHotspotNetwork.fetchCurrent { network in
181
- currentSSID = network?.ssid
182
- }
183
- return currentSSID
184
- } else {
185
- guard let interfaces = CNCopySupportedInterfaces() as? [String] else {
186
- return nil
187
- }
188
-
189
- for interface in interfaces {
190
- guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else {
191
- continue
192
- }
193
-
194
- return interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
195
- }
196
-
197
- return nil
178
+ var currentSSID: String?
179
+ NEHotspotNetwork.fetchCurrent { network in
180
+ currentSSID = network?.ssid
198
181
  }
182
+ return currentSSID
199
183
  }
200
184
 
201
185
  private func getLocationPermissionStatus() -> String {
202
- if #available(iOS 14.0, *) {
203
- switch CLLocationManager.authorizationStatus() {
204
- case .authorizedAlways, .authorizedWhenInUse:
205
- return "granted"
206
- case .denied, .restricted:
207
- return "denied"
208
- case .notDetermined:
209
- return "prompt"
210
- @unknown default:
211
- return "prompt"
212
- }
213
- } else {
214
- let status = CLLocationManager.authorizationStatus()
215
- switch status {
216
- case .authorizedAlways, .authorizedWhenInUse:
217
- return "granted"
218
- case .denied, .restricted:
219
- return "denied"
220
- case .notDetermined:
221
- return "prompt"
222
- @unknown default:
223
- return "prompt"
224
- }
186
+ switch CLLocationManager.authorizationStatus() {
187
+ case .authorizedAlways, .authorizedWhenInUse:
188
+ return "granted"
189
+ case .denied, .restricted:
190
+ return "denied"
191
+ case .notDetermined:
192
+ return "prompt"
193
+ @unknown default:
194
+ return "prompt"
225
195
  }
226
196
  }
227
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-wifi",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "description": "Manage WiFi connectivity for your Capacitor app",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -41,7 +41,7 @@
41
41
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
42
42
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
43
43
  "eslint": "eslint . --ext ts",
44
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
44
+ "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
45
45
  "swiftlint": "node-swiftlint",
46
46
  "docgen": "docgen --api CapacitorWifiPlugin --output-readme README.md --output-json dist/docs.json",
47
47
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
@@ -67,7 +67,8 @@
67
67
  "rimraf": "^6.1.0",
68
68
  "rollup": "^4.53.2",
69
69
  "swiftlint": "^2.0.0",
70
- "typescript": "^5.9.3"
70
+ "typescript": "^5.9.3",
71
+ "prettier-pretty-check": "^0.2.0"
71
72
  },
72
73
  "peerDependencies": {
73
74
  "@capacitor/core": ">=8.0.0"