Enable hotspot using Swift

Hi,

I am lookig for a way to activate Hotspot from my app without existing to the netowrk settings screen.


My goal is to have a minimum user interaction (defining hotspot name, hotspot password, ect..). All I want from the usre is permission to activate a hotspot (will be done by somekind of dialog).

I looked into `

NEHotspotConfiguration` and `NEHotspotConfigurationManager` to confiure a hotspot and connect as follow:

```

1. let hotspotConfig = NEHotspotConfiguration(ssid:***, passphrase:***, isWEP: false)

2. hotspotConfig.joinOnce = false

3. NEHotspotConfigurationManager.shared.apply(hotspotConfig)

```

This enable me to configure a personal wifi AC but I can't "see" it from other devices.


My goal is to activate hotspot so other devices can connect to it.


I understood that I need special approval from apple to use NetworkExtension framework and I sent a request over 2 weeks but I still did not recieve any reply besides a request number.

Replies

Thanks for the help, now I know this direction is closed and I need to figure out different solution

Hi eskimo,


My project requirement is to "Force the iOS device to join a specific Wi-Fi network (SSID and password of WIFI network is known) that’s being published by some other hardware?


To do this I have written below code:


let config = NEHotspotConfiguration(ssid: "strSSID", passphrase: "strPassword", isWEP: false)

config.joinOnce = true

NEHotspotConfigurationManager.shared.apply(config) { (error) in

if error != nil {

print(error!.localizedDescription)

callBack(false)

}

else {

print(String(format:"Successfully connected to the Wi-Fi %@",strSSID))

callBack(true)

}

}


I have to import NetworkExtension framework to execute above code.

Do I need to get the special entitlement permission from Apple to publish my application to the AppStore?

Please respond.


Regards,

Nagraj Wadgire

Since the last answer dates from 2 years ago. Any chance that this is possible in newer iOS updates? Creating a personal hotspot from app.

Creating a personal hotspot from app.

You have misunderstood the focus of this thread. It’s not about setting up Personal Hotspot but rather about getting iOS to join an existing Wi-Fi network. You can do the latter using NEHotspotConfigurationManager. Doing the former is not possible. Personal Hotspot is a user-level feature and has no developer API at all.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

For update, this feature still not possible yet?

Regards, JE.Montero