How can you disable the iOS Notification Center within your App?

前端 未结 4 989
青春惊慌失措
青春惊慌失措 2020-12-28 14:55

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

4条回答
  •  有刺的猬
    2020-12-28 15:08

    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.

    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.

    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.

提交回复
热议问题