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