1:cmd+l Lock Screen
iOS local notifications do not push messages while the program is running, but only when the program enters the background.
-(ibaction) addlocalnote {//1. Create a notificationUilocalnotification *localnote =[[Uilocalnotification alloc] init]; //2. Setting Properties//Action TitleLocalnote.alertaction =@"Start playing games"; //What's displayedLocalnote.alertbody =@"It 's been a couple of days, so just use me for a moment!!!"; Localnote.applicationiconbadgenumber=1; //Alert FrequencyLocalnote.repeatinterval =Nscalendarunitminute; Localnote.alertlaunchimage=@"Default";//Click on the notification to open the program when the actual startup picture//when to come out (come out 5 seconds from the current time)Localnote.firedate = [NSDate datewithtimeintervalsincenow:5]; //3. Registration Notice (ADD)UIApplication *app =[UIApplication sharedapplication]; [App Cancelalllocalnotifications]; //Customizing a local notification[app Schedulelocalnotification:localnote];}
iOS Local notifications