how to disable wifi assist without user interaction
Asked Answered
Q

3

6

I have couple of URLs that has to be called(programatically) through wifi not with mobile data.

As WIFI ASSIST is on , whenever the wifi is weak ,packets get transferred through Mobile data.

I would like to stop this from happening.

As far as I have researched, there is no API to toggle wifi assist switch on and off programatically

I can find if the user has mobile data and wifi on with the help of Reachability Class I believe and I can alert the user to keep wifi assist off but this is a very bad user experience.

so I decided to look if its possible to be done with the help of iOS mobile configuration file.

But I couldn't find any keys related with wifi-assist in Apple configuration profile reference.

so I am wondering , is it possible to force wifi to be used for certain URLs.

I remember this is possible with VPN ON DEMAND we can have certain domains to be accessed via VPN.

I am wondering if same is possible for wifi as well through configuration profile

Any suggestions are welcome.

Quotient answered 10/4, 2018 at 12:46 Comment(5)
Seem like it's impossible. Maybe this post can help you a little #41185476Whiplash
See if something in this helps? github.com/joninsky/DJiOSSDK/blob/…Heavyset
With this I can find if network connection goes through mobile data and alert user to turn off mobile data and get on with wifi but its a very bad user experience and so I am thinking to do with mobile configuration profile and its just a one time user activityQuotient
It seems as though there are ways to make the experience better. Sonos seems to have done something to help with the problem for their users: sonos.custhelp.com/app/answers/detail/a_id/4257/~/…. I'm wondering if you can set up the URLSession to not allow use of cellular. The problem with this approach is that I believe it will simply delay the URLRequest until using WiFi again. What I don't know is whether the existence of the request while WiFi assist is active might make iOS switch back to Wifi.Norse
#36303623Torchwood
N
4

As others have mentioned, there is no way to do manipulate this setting programmatically in iOS. This is not really what you are asking, as you seem to already know the answer to this is "No".

You are asking about the configuration profile, so I am assuming these are managed devices. Unfortunately, there is no configuration profile payload I am aware of that forces the managed devices to disable Wi-Fi Assist.

Your intent, however, is a bit different than what is being asked, I believe. I think you basically have an app that communicates with a resource that is only accessible via the Wi-Fi network (likely a corporate Wi-Fi network). If the app tries to connect to the resource while on cellular, it will not be able to connect. In some cases, when the Wi-Fi signal is weak, the device tries to be helpful and switches to cellular, causing issues with the app. If we could figure out a way to force iOS to not take advantage of Wi-Fi Assist when your app is running, you would be in good shape.

If you can install this app as a managed app, there is a way to identify that the app should only be allowed to run on a Wi-Fi connection. Setting the network usage rules AllowCellularData to false should do this (see this for more details). The thing I am not sure of with this solution, is whether this simply causes the connections to fail when Wi-Fi Assist is on and active, or if it makes iOS prefer to not use Wi-Fi assist when the app is running because it cannot connect over cellular. So I think you can tell an app to only connect over WiFi, but it doesn't really give you a better solution to your user experience problem. The only think it really buys you is that your app connection won't ever try to connect when connected to cellular. There is a chance, however, if you change this value to false for your app bundle ID, it will prevent Wi-Fi Assist from enabling when your app is running. I don't have access to MDM to try it out, but you could test and see.

Ultimately, given that this is probably a corporate device situation, I think you are going to have to address this through user training. The good news is that this is a one-time step. Sure, users may have slight degradation of network performance when Wi-Fi signal is weak but cell signal is strong. This does not matter as much if these are corporate devices where the corporate apps will mostly work only on the company's Wi-Fi network.

Another solution is what you mentioned, basically using on-demand VPN to provide a connection to the internal resources. This is additional infrastructure work, and you already mentioned it, so I'm not sure if it is even an option.

Obviously, the other solution would be to expose the network resources through your firewall, which could allow you to access it over cellular. I'm suspecting this is not possible due to security constraints.

Unfortunately, there are not a lot of good options in this space. However, have hope that there is some way to do it, as Sonos appears to have done something to allow their app to avoid switching to WiFi Assist while streaming to a local network resource: https://sonos.custhelp.com/app/answers/detail/a_id/4257/~/wi-fi-assist-and-sonos

I wonder if you could have your app open a streaming audio connection to a fixed local network resource, which would cause it to use Wi-Fi. It's a pretty crazy hack, but with a low enough bitrate audio file streaming, it might do what you need while not eating up too much of the network throughput.

Per Apple's notes on Wi-Fi Assist:

  • Wi-Fi Assist won't automatically switch to cellular if you're data roaming.
  • Wi-Fi Assist only works when you have apps running in the foreground and doesn't activate with background downloading of content.
  • Wi-Fi Assist doesn’t activate with some third-party apps that stream audio or video, or download attachments, like an email app, as they might use large amounts of data.

Of course the other possible solution that you could consider is improving your Wi-Fi coverage to that the signal doesn't get bad enough for Wi-Fi Assist to be needed. I know this may not be feasible, but wanted to put it out there.

Good luck with this!

Norse answered 17/4, 2018 at 20:15 Comment(1)
Thanks for highlighting AllowCellularData.It can be potentially useful for my use caseQuotient
B
2

There is no public API that allows you to enable/disable "Wi-Fi Assist", and even if you find a way to do it your app will be rejected.

Boodle answered 13/4, 2018 at 12:6 Comment(3)
That's the reason I am looking to do with the help of configuration profile but there's not much information available about that eitherQuotient
1. You are not allowed to change user settings, as I mentioned even if you find a way to do that your app will be rejected after review process. 2. You could test connection quality and force user to use cellular data or Wi-Fi but this is also forbidden to do. You should read App Store Review GuidelinesBoodle
Agreed we can't do it programatically that's why I am exploring if that can be done by means of apple configuration file.Quotient
B
0

No you can not enable or disable WiFi by programmatically and there is no API for this.

Bianco answered 10/4, 2018 at 12:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.