clemenstyp / HotspotClient

Simple iOS framework which helps you connects iOS device to specific Wi-Fi from the app.

Home Page:https://markoengelman.com/how-to-connect-to-wi-fi-device-from-ios-app-using-swift/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lightweight HotspotClient framework

CI-iOS

  • Simple iOS framework that helps you connect iOS device to specific Wi-Fi network from you application.
  • Framework supports iOS from 11.0

Installation

Swift package manager

dependencies: [
  .package(url: "https://github.com/bkyarger/HotspotClient.git", .branch("main")
]

How to use

If you want to run 'Wi-Fi' validation after successfully applying configuration use HotspotClientWithValidation. By default you can use already provided HotspotClientValidationPolicy or you can inject your own policy based on your needs.

let client = NEHotspotClient(hotspotManager: .shared)
let ssidLoader = SystemSSIDLoader()
let validatedClient = HotspotClientWithValidation(
  client: client, 
  ssidLoader: ssidLoader, 
  policy: HotspotClientValidationPolicy.validateRetryCount
)

let configuration = HotspotConfiguration(
  ssid: "anySSID", /* SSID of target network */
  password: "anyPassword", /* Passhprase of target network */
  isWEP: false, 
  joinOnce: true
)

validatedClient.connect(with: configuration) { result in }

About

Simple iOS framework which helps you connects iOS device to specific Wi-Fi from the app.

https://markoengelman.com/how-to-connect-to-wi-fi-device-from-ios-app-using-swift/

License:MIT License


Languages

Language:Swift 100.0%