Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know if cellular access for my iOS app is disabled?

I have an iOS app that makes some small network requests on app launch (resource updates, etc). If the user turns off cellular access for the app in iOS Settings, they get a prompt from iOS about network usage every time they launch. Is there a way to know programmatically that cellular data for this app has been disabled, so that I can disable the requests at startup?

like image 333
Tom Hamming Avatar asked Mar 21 '14 15:03

Tom Hamming


People also ask

Why is my cellular not working on certain apps on my iPhone?

Settings -> Cellular -> You will see a list of all of your apps. Make sure that the switches are on (green) for those apps that you want to allow to use Cellular Data.

How do I see app permissions on iPhone?

Review how apps are using the permissions you grant themGo to Settings > Privacy & Security, then tap App Privacy Report. The App Privacy Report shows you how apps are using the permissions you granted them and shows you their network activity.


1 Answers

So I found this on the apple dev forums from an Apple engineer (https://devforums.apple.com/message/1059332#1059332).

Another developer wrote in to DTS and thus I had a chance to investigate this in depth. Alas, the news is much as I expected: there is no supported way to detect that your app is in this state. Nor is there a way to make a "no user interaction" network connection, that is, request that the connection fail rather than present UI like this. If these limitations are causing problems for your app, I encourage you to file a bug describing your specific requirements.
https://developer.apple.com/bug-reporting/

So it looks like it is not possible to detect if cellular data for your app has been turned off.

Edit

I filed a radar for this requesting that it be added. I just got this notification in my radar

We believe this issue has been addressed in the latest iOS 9 beta.

I looked through the API diffs, but so far I can't find the new API.

like image 121
Stephen Johnson Avatar answered Nov 04 '22 23:11

Stephen Johnson