0

我正在使用以下代码发出本地通知:

UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
    return;
localNotif.fireDate = [NSDate dateWithTimeIntervalSinceNow:30]; //itemDate;
localNotif.timeZone = [NSTimeZone defaultTimeZone];

// Notification details
localNotif.alertBody = parentController.activeAssignment.notes;
// Set the action button
localNotif.alertAction = @"View";

localNotif.soundName = UILocalNotificationDefaultSoundName;

// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];

我已经使用该方法进行了检查

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification

通知正在触发,但当应用程序在后台运行时未显示在我的屏幕上。

4

0 回答 0