// To execute the notification, you must exit the application or suspend the application (enter the background) to receive the notification.
// Create a local notification
UILocalNotification *notification = [[UILocalNotification alloc] init];
// Notification trigger time
notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:];
// Notification Time Zone
notification.timeZone = [NSTimeZone defaultTimeZone];
// Notification content
notification.alertBody = ;
// Notification tone
notification.soundName = UILocalNotificationDefaultSoundName;
// Number displayed in the upper-right corner of the application
notification.applicationIconBadgeNumber = ;
// Data dictionary
notification.userInfo = @{: , : @()};
// Start this notification
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
// Enter the foreground and clear the icon in the upper right corner
- ()applicationWillEnterForeground:(UIApplication *
// Click the top notification to enter the application
- ()application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification **alert = [[UIAlertView alloc] initWithTitle: message:notification.userInfo[] :nil cancelButtonTitle:
// Clear all notifications of the current application
[[UIApplication sharedApplication] cancelAllLocalNotifications];