iOS Easy Reminder Management class can be used when the alarm

Source: Internet
Author: User

GitHub Address: Https://github.com/li6185377/LKAlarmManager

Add "Your reminders" to your calendar or local notifications quickly and easily
Automatic processing of more than 64 local notifications

QQ Group No. 113767274 What's the problem or the improvement of the place we discuss together

Use Example 1, the following three uiapplication callback, passed to Lkalarmmanager

- (BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary*) launchoptions {[[LkalarmmamagerSharemanager]didfinishlaunchingwithoptions:Launchoptions];return YES;} -(BOOL) Application: (UIApplication *) application OpenURL: (Nsurl*) URL sourceapplication: (NSString*) sourceapplication Annotation: (ID) annotation{[[LkalarmmamagerSharemanager]Handleopenurl:URL];return YES;} -(void) Application: (UIApplication *) application didreceivelocalnotification: (uilocalnotification *) notification{[[ LkalarmmamagerSharemanager]didreceivelocalnotification:Notification];}

2, add reminders to the Lkalarmmanager.

lkalarmevent* event = [lkalarmeventNew]; Event.title = @ " participate in Calendar events " ; Event.content = @ " only added to the calendar is used, is the notes in the Calendar " ;/// weekday remindersEvent.repeattype = Lkalarmrepeattypework;remind me///60 seconds later .Event.startdate = [NSDate Datewithtimeintervalsincenow: -];/// can also be forced to add to local reminders    //event.isneedjoinlocalnotify = YES;    /// will try to join the calendar first if the calendar does not have permission to join the local reminder[[LkalarmmamagerSharemanager]addalarmevent:EventCallback:^ (Lkalarmevent *alarmevent) {Dispatch_async(Dispatch_get_main_queue(), ^{uilabel* label = ((viewcontroller*) _window.Rootviewcontroller).Lb_haha;if(AlarmEvent.Isjoinedcalendar) {label.text= @ " joined Calendar " ; }Else if(AlarmEvent.isjoinedlocalnotify) {label.text= @ " local notifications added " ; }Else{label.text= @ " Join notification failed " ;    }        }); }];

3, register Lkalarmmanager callback, receive a reminder to do what you want to do

    ///regist Delegate[[LkalarmmamagerSharemanager]Registdelegatewithobject: Self];-(void) Lk_receivealarmevent: (lkalarmevent *) event{uialertview* alertview = [[Uialertview]Alloc]initwithtitle: @ " Accept the notification! " message:Event.titleDelegate:Nil Cancelbuttontitle: @ " OK "  Otherbuttontitles:Nil]; [AlertviewShow];}

iOS Easy Reminder Management class can be used when the alarm

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.