UILocalNotification iOS5 问题(不显示警报)
是只有我一个人还是Apple打破了iOS5(GM+公开发布)中的UILocalNotification机制?它在测试版中似乎运行良好,但由于 GM 仅播放声音,因此不会显示任何警报(是的,我已经检查了通知设置,并且该应用程序全部打开)。
我还制作了一个小型独立项目(为了安全起见,使用了一个全新的应用程序标识符),并使用一些非常简单的代码测试了 UILocalNotification 类,顺序如下:
UILocalNotification *singleLocalPush = [[UILocalNotification alloc] init];
singleLocalPush.fireDate = [NSDate dateWithTimeIntervalSinceNow:15];
singleLocalPush.hasAction = YES;
singleLocalPush.alertBody = @"Alert Body";
singleLocalPush.alertAction = @"Alert Action";
[[UIApplication sharedApplication] scheduleLocalNotification:singleLocalPush];
有人遇到类似的问题吗?如果您的应用程序与本地通知有关,这会非常烦人:)
最好, 卡茨佩尔
Is it only me or did Apple break the UILocalNotification mechanism in iOS5 (GM + public release)? It seemed to work fine in the betas but since GM only the sound plays back, no alert is shown (yes I have checked the Notification Settings and the app is all on ON).
I've also made a small separate project (with a brand new app identifier just to be on the safe side), and tested the UILocalNotification class with some very simple code, on the order of:
UILocalNotification *singleLocalPush = [[UILocalNotification alloc] init];
singleLocalPush.fireDate = [NSDate dateWithTimeIntervalSinceNow:15];
singleLocalPush.hasAction = YES;
singleLocalPush.alertBody = @"Alert Body";
singleLocalPush.alertAction = @"Alert Action";
[[UIApplication sharedApplication] scheduleLocalNotification:singleLocalPush];
anyone experience similar problems? This is pretty annoying if your app IS about local notifications :)
Best,
Kacper
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该确保您的应用程序已启用通知 -
导航至设置 -> 通知并确保您的应用程序已启用。
我的应用程序的本地通知在 iOS 5 上运行良好,并且设置为部署到 3.1.2。
You should make sure your app is enabled for notifications-
Navigate to Setting->Notifications and make sure your app is enabled.
My app's local notifications work fine on iOS 5, and it was set to be deployed to 3.1.2.