iOS Local notifications

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.