Enable personal hotspot programatically in iOS using Swift or Objective-C - ios

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.

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.

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.

Related

Redirecting Data flow to either wifi or Cellular in ios

I want ot redirect my iPhone data to either wifi or Cellular. Based on some criteria. Is it possible to redirect whole of the iPhone data to a particular interface like to either wifi or cellular. ?
I heard that this can be done using VPN but no idea how it can be done.
Any help on this?
By default, iOS help you with redirection when you have weak/good WiFi and switch on in Setting - WLAN Assist
MultiPath is a technology switching automatically by OS
Just read this Apple Doc for more help.
You can't manipulate it easily with high level API.
After all, changing device data flow is kind of low level thing. Just like NetworkExtension is Apple provided. As far as I know, Apple does not mention it in public.

How to display custom text in ios wifi settings

I have a very specific question in programming an ios app.
In general when you open your ios wifi settings, there should be a list of available networks to choose.. so far..
now I want that in some cases, if a network meets specific requirements, a text is diplayed down below the network name (e.g. like "connect with WIFIAPP") and by clicking on the network you open the "WIFIAPP"..
Is there any possibility to do that and if yes, how? A framework or something like that?
Hope you guys understand my concern..
Thank you for any help!
Daniel
The feature you are after is implemented by the NEHotspotHelper class in the Network Extension Framework. In order to use this class you need to complete a questionnaire and be authorised by Apple.
More details are included in the Hotspot Network Subsystem Programming Guide, but essentially your app runs in the background and takes part in the network scanning process. It can provide an annotation for recognised networks and the user can invoke your app from Settings in order to complete the network authentication.
Unfortunately, access to wifi network parameters is completely closed from developers. From your app you can only tell apart if device is closed to wifi or 3G cellular network. Nothing more. I don't even say about native Settings app. You can do only some extra limited things outside of your app, like play music, or show your custom Widget.

WiFi Authentication Without MAC Address (iOS)

I’m currently working on a small project with the goal of using an iOS App to provide a secure, centralized login for a network of WiFi hotspots in small and medium sized businesses. The plan was to configure the routers as open networks and DHCP forward all the traffic from the router to our (cloud-hosted) server, where each query is authenticated and the user’s query is allowed to pass to its intended destination.
Our current problem is that in order to configure the server to know which users are accessing it we need the Mac Addresses of the users, which the Apple API requires they type in manually the first time they use the app (which is a lot of work) so we are trying to come up with a work around.
Any thoughts or suggestions would be hugely appreciated.
Thanks,
Alex
:)
Since iOS 7 you can no longer get the MAC Address. Based on what you are trying to do, I would recommend using one of the device identifiers available through iOS like identifierForVendor which will give you an unique id.
as per Apple Docs:
In iOS 7 and later, if you ask for the MAC address of an iOS device,
the system returns the value 02:00:00:00:00:00. If you need to
identify the device, use the identifierForVendor property of UIDevice
instead. (Apps that need an identifier for their own advertising
purposes should consider using the advertisingIdentifier property of
ASIdentifierManager instead.)

How will HAP over cloud will work?

Apple have added new features in Homekit framework in iOS 9.
I have seen What's New in HomeKit.
In that they have added support of Homekit Accessory Protocol (HAP) over cloud. But they didn't tell how it will work, what developers need to do to support accessories to accessible from apple's cloud services.
I have reviewed their HAP for IP Accessories R3 document, but that document also didn't have any information on this.
What I am looking for is, there should be something at Accessory (Light, Thermostate or bridge) which is added to home in Homekit enabled application and which is accessible for user logged in with icloud account.
Now, to support HAP over cloud at accessory side developer needs to do something so that it can identify for user for which its configured.
So what are the changes require at bridge(gateway or hub) or accessory to implement HAP protocol over cloud?
I have been working on HAP Over iCloud concept since last 2 to 3 hours. The beauty in this concept is according to the documentation we should need the following things.
Apple tv 3rd generation
Have to use same iCloud account in both apple tv and iOS device.
This is most important that Apple tv and Accessory should be on same network.
Eventhough you are on different network it is able to pass the switch on/off,brightness increase/decrease ... actions. For this you can use siri commands or programmatically call the accessory write value functionality
Note : As I know I think when you are passing the commands to the Accessory it checks for the iCloud account in the apple tv and from there it is passing the commands to the Accessory. The apple tv and the accessory both are in same network so apple tv will reach that accessory. Thus apple tv acts as a mediator between the iOS device and Accessory

Can I see the different WiFi SSID and their channels with iOS?

I would like to know the way for how to get the SSID of all WiFi hotspot around me and their channels.
I have been researching in the forum and I think I can't if I want upload my App to AppStore because I had to use a private library.
Is it right or not? :(
At the moment you can only see current connected SSID details using the CaptiveNetwork framework here unless you use some private library as you said but this will get rejected. From my research Apple have been restricting access to WIFI services all developers apart from a few like the Boingo, Vodafone or BT app. See this comment from Apple support engineer here about this topic, most of which state to submit a DTS request...

Resources