How to invoke “Turn Off Airplane Mode” notification

后端 未结 5 1679
南方客
南方客 2020-12-14 11:00

In many applications, such as the Mail app, if the device is in airplane mode a notification will pop up that says \"Turn Off Airplane Mode or Use Wi-Fi to Access Data.\"

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 11:47

    You could use the apple's reachablity framework when you app launches to check for network connectivity. Check this out

    http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html

    I have a wrapper class for reachbiltiy APIs to make it simpler to use. (ASIHTTPRequest has one as well).

    https://github.com/daltoniam/GPHTTPRequest

    see the GPReachablity class for checking for connectivity. As far as a dialog prompt, not sure there is a way to push to the settings app. Any questions let me know.

提交回复
热议问题