Set default iOS local notification style for application(为应用程序设置默认的 iOS 本地通知样式)
问题描述
从 iOS 5 开始,有两种通知样式:横幅和警报(旧"样式).用户可以在设置中为每个应用程序设置使用哪种样式.但是,现在的默认设置似乎是通知以横幅样式显示.
Starting with iOS 5, there are two notification styles: banner and alert (the "old" style). A user can set which style to use for each application in the settings. However, the default now seems to be that notifications are displayed banner style.
我正在使用本地通知来提醒现在"将要发生的事件.横幅在它出现后不久就会消失(并且它不够明显以至于人们可以点击它),因此对于这些通知,最好有警报样式通知,因为这些通知会一直留在屏幕上,直到用户决定采取行动(忽略或去到应用程序).
I'm using local notifications for reminders about events that will happen "now". A banner disappears shortly after it appeared (and it's not obvious enough that one can tap it), so for these notifications it would be desirable to have the alert style notifications as those stay on screen until the user decided on an action (ignore or go to app).
有没有办法通过代码或例如 Info.plist
条目告诉 iOS 默认情况下应该使用警报样式通知(只要用户没有配置其他东西)?
Is there a way either through code or for example Info.plist
entries to tell iOS that the alert style notifications should be used by default (as long as the user hasn't configured something else)?
更新:信息/文档的缺失不足以让我解决这个问题.我想要一个有权威的人(Apple 员工或类似 Erica Sadun 的人)发表的论坛/博客帖子之类的东西,说这是不可能的,或者如果有可能,那么我想要解决方案.要求用户更改设置" 之类的解决方法也不够好.
Update: The absence of information/documentation is not enough for me to have this settled. I want either something like a forum/blog post from someone with authority (Apple employee or someone along the lines of Erica Sadun) saying it's not possible, or if it is possible then I want the solution. A workaround like "ask the user to change the setting" isn't good enough either.
推荐答案
我想补充一点,因为我已经打开了一个 TSI,不知何故我问了这个问题并得到了答复.来自奎因爱斯基摩人!":
I would like to add something, since I've opened a TSI and somehow I asked about this and have been answered. From Quinn "The Eskimo!":
这取决于您的意思.您可以根据您设置 UILocalNotification 属性(如 alertBody、soundName 等)的方式来控制通知的显示方式.但是,如果您询问进入的方式这些属性被解释(用户可以在设置>通知中自定义的东西),这些是用户偏好,不通过任何 API 公开."
"This depends on you mean. You have some control over how the notification appears based on how you set the UILocalNotification properties (things like alertBody, soundName, and so on). However, if you're asking about the way in which those properties are interpreted (the things the user can customise in Settings > Notifications), those are user preferences and not exposed via any API."
这篇关于为应用程序设置默认的 iOS 本地通知样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为应用程序设置默认的 iOS 本地通知样式
基础教程推荐
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01