skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. This is not possible. From Apple’s Forums:

    There’s no way to do this programmatically. You can get the iOS device’s current Wi-Fi network SSID using
    CNCopyCurrentNetworkInfo
    , but there’s no way to get the corresponding credentials.

    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,

    You can just open device Settings view from app.

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search