Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
331 views
in Technique[技术] by (71.8m points)

ios5 - Set default iOS local notification style for application

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

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)?

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.

question from:https://stackoverflow.com/questions/8229385/set-default-ios-local-notification-style-for-application

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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!":

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...