I am looking for a way to enable personal Hotspot programatically in iOS using Swift or Objective-C but did not see any API or way to achieve that.
My question is that even possible to do that?
Does Apple allow that?
Also as per Apple Developer Documentation HotSpot Helper what are the controls we can achieve that ??
Hotspot Communication
Hotspot helpers can use these APIs to communicate with the hotspot even when Wi-Fi is not the default route.
func bind(to: NEHotspotHelperCommand)
Binds a URL request to the network interface associated with the hotspot helper command instance.
In-Provider Networking
Network APIs for use by all types of NetworkExtension providers and by hotspot helpers.
2
Answers
Apple don’t provide any API to Turn On/Off Personal Hotspot. Rather, you can’t change any user setting via code. You can just open device
Settings
view from app.Apple’s privacy policies will not allow you to do this.
This is not possible. From Apple’s Forums:
If iOS did allow this, this would be a privacy and security risk. There is no private API to do this either. As Pushkraj Lanjekar said,
There is no way to programatically control personal hotspot on an iOS device.
This Apple Forums link may be helpful, however; https://developer.apple.com/forums/thread/113933.