开发者

UILocalNotification iOS5 issue (no alert shown)

开发者 https://www.devze.com 2023-04-12 21:21 出处:网络
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 h

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? Th开发者_如何学Pythonis is pretty annoying if your app IS about local notifications :)

Best, Kacper


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消