In my app i am using alarm functionality. Its working fine but when i am testing in simulator the alarm notified with the popup box. In real device it just come as notification in status bar instead of popup box.
I am looking for popup box in real device. I am not sure what i am doing wrong here?
I am using this code for my alarm
[[UIApplication sharedApplication] cancelAllLocalNotifications];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = date;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = alarmMessage;
localNotification.alertAction = NSLocalizedString(@"View", nil);
localNotification.repeatInterval = NSDayCalendarUnit;
/* Here we set notification sound and badge on the app's icon "-1"
means that number indicator on the badge will be decreased by one
- so there will be no badge on the icon */
NSString *ringtonename = [lblRingToneName text];
NSString *extension = @".caf";
NSString *ringtone = [[NSString alloc]initWithFormat:@"%@%@", ringtonename, extension];
localNotification.soundName = ringtone;
localNotification.applicationIconBadgeNumber = -1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
Thanks for your help guys
If the device is locked the notification would displayed as pop box,if a app is running the notification would displayed in status bar, there is nothing about your code.