iOS 5:我可以将我的应用“放入通知中心”吗?默认? [英] iOS 5: Can I have my app "In Notification Center" by default?

查看:92
本文介绍了iOS 5:我可以将我的应用“放入通知中心”吗?默认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在App Store中有一个iPad应用程序,其逻辑很大程度上依赖于本地通知。换句话说,应用程序内部发生的很多事情都是由委托方法应用程序didReceiveLocalNotification触发的。

I have an iPad app in the App Store whose logic relies largely on local notifications. In other words, much that happens inside the app is triggered by the delegate method application didReceiveLocalNotification.

随着今天发布的iOS 5,我看到可以放置应用程序(通过设置)在通知中心或不在通知中心。到目前为止,我还没有在新文档中找到任何内容,但我希望有一种方法可以默认将我的应用程序设置为In Notification Center,(甚至可能将Sounds设置为active并将通知类型设置为Alert)除了明确向新用户解释他们下载后,我还要保存。安装我的应用程序,他们必须手动选择该应用程序为在通知中心。

With today's release of iOS 5, I see that apps can be placed (via Settings) either "In Notification Center" or "Not In Notification Center." I haven't found anything in the new documentation so far, but I'm hoping there is a way to have my app "In Notification Center" by default, (and possibly even set Sounds active and the notification type to Alert) which would save me having to explicitly explain to new users that after they download & install my app, they will have to manually go and elect for the app to be "In Notification Center."

任何人都知道这是否可行?似乎由于应用程序可以注册本地通知,因此默认情况下它应该能够接收它(无论它是否在新的通知中心中显示警报或项目)。在此先感谢。

Anyone know if this is possible? Seems that since an app can register a local notification, it should be able to receive it, by default (whether it displays an alert or an item in the new Notification Center, or not). Thanks in advance.

推荐答案

我遇到了同样的问题。我在文档中看到的唯一线索是新的通知中心处理本地和远程通知。因此我假设应用程序应该注册本地,因为它将用于远程通知。添加了这段代码 -

I've encountered the same problem. The only clue I saw in documentation is that the new Notification Center handles both local and remote notifications. Therefor I assumed that the app should register for local as it would for remote notification. Added this piece of code -

[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

在我的应用安排本地通知后,它出现在通知中心。

and after my app scheduled a local notification it appeared at the "In Notification Center".

但是如果我的应用程序已经出现在Not In Notification Center中,它似乎没有任何影响。那么,在下次更新被搞砸之前,我的所有客户都运行了应用程序吗?

BUT it seems to have no affect if my app already appears in "Not In Notification Center".. So have all of my customers that ran the app before the next update got screwed?

这篇关于iOS 5:我可以将我的应用“放入通知中心”吗?默认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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