如何在应用程序中禁用iOS通知中心? [英] How can you disable the iOS Notification Center within your App?

查看:104
本文介绍了如何在应用程序中禁用iOS通知中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你有一个全屏iOS应用程序,并且你想阻止通知中心被拉下来,你可以和如何?

If you have a full screen iOS app and you want to prevent the notification center from being pulled down, can you and how?

您还可以在加载应用时屏蔽通知提醒或横幅广告吗? (我认为这是肯定无法肯定的,但是想要以防万一。)

Also can you block notification alerts or banners from displaying while your app is loading? (I think this is a no way for sure but wanted to ask just in case.)

推荐答案

这是我的经验全屏应用程序( statusBarHidden = YES )默认情况下通知中心行为略有不同:向下滑动以前由状态栏占据的区域只会显示一个小标签。只有滑动选项卡才会显示通知中心。到目前为止,这足以防止我意外激活。

It has been my experience that fullscreen apps (statusBarHidden = YES) have a slightly different notification center behavior by default: Swiping down over the area previously occupied by the status bar will only show a little tab. Only swiping the tab will then show the notification center. This has been enough to prevent accidental activation for me so far.

目前,没有用于操纵通知中心行为的公共API。我认为应用程序不太可能能够阻止通知的外观,并且应用程序能够阻止通知中心出现的可能性稍微小一些。 iOS以开发人员自由为代价,提供一致的用户体验体验。如果我是一个无意识的用户,我可以看到被这种功能感到沮丧。

Currently, there is no public API for manipulating the behavior of the notification center. I am of the opinion that it's not likely that an app will ever be able to block a notification's appearance, and only slightly less unlikely that an app would be able to prevent the notification center from appearing. iOS is all about a consistent user experience experience at the price of developer freedom. I could see being frustrated by this kind of functionality if I were an unexpecting user.

所有这一切,总是存在未记录的API的黑暗面。如果你能在越狱设备上使用那些聪明,我不会感到惊讶,但这不是我的杯茶。

All that said, there is always the dark-side of undocumented APIs. I would not be surprised if you could pull off some cleverness using those on a jailbroken device, but that's not my cup-o'-tea.

这篇关于如何在应用程序中禁用iOS通知中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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