当您的应用程序处于后台时,您可以发出本地通知。所以根据你的说法,如果警报视图没有出现,但你仍然希望用户知道发生了什么事情或出了什么问题,那么你可以直接使用本地通知。
这是代码 -
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = self.datePicker.date;
localNotification.alertBody = self.messageField.text;
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = 1;
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Object 1", @"Key
1", @"Object 2", @"Key 2", nil];
localNotification.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
因此,当本地通知生成时,用户可以知道这一点。您可以将用户导航到直接到应用程序。点击关闭本地通知警报。本地语言通知警报将自动出现。
这里是更多细节的链接 -
http://www.iostipsandtricks.com/ios-local-notifications-tutorial/