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

后端 未结 6 1046
别那么骄傲
别那么骄傲 2020-11-29 04:21

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

6条回答
  •  Happy的楠姐
    2020-11-29 04:45

    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.

提交回复
热议问题