如何调用“关闭飞机模式”通知 [英] How to invoke "Turn Off Airplane Mode" notification

查看:109
本文介绍了如何调用“关闭飞机模式”通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在许多应用程序(例如邮件应用程序)中,如果设备处于飞行模式,则会弹出一条通知,说关闭飞行模式或使用Wi-Fi访问数据。

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."

我认为如果我的应用程序尝试访问互联网,这将自动调用,但它不是。是否有特殊的方法来执行此操作,或者如果没有,如何检查设备是否处于飞行模式,并提供指向设置的链接以禁用它?

I thought that this would automatically be invoked if my app tries to access the internet, but it is not. Is there a special method to do this, or if not how can I check if the device is in airplane mode and provide a link to Settings to disable it?

推荐答案

如果您将 UIRequiresPersistentWifi 键添加到您的 Info.plist code> YES ,那么如果您处于飞行模式,您将在启动时看到标准的关闭飞行模式...弹出窗口。

If you add the UIRequiresPersistentWifi key to your Info.plist and set it to YES, then if you're in Airplane mode, you'll get the standard "Turn Off Airplane Mode..." popup on launch.

这篇关于如何调用“关闭飞机模式”通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆