How to send a local push notification
Push notifications are also part of the UI, so push notification objects start with the UI
Method Send notification Code method Controller-touchesbegan:withevent: Test, more appropriate, put into the Viewdidload method, the user's registration request has not completed the method called
1. Set the contents of the notification (if this property is not set to send a notification) Ln.alertbody = @ "Xiaoming, your mother told you to go home for dinner!"; /2. Set the start time of the notification trigger ln.firedate = [NSDate datewithtimeintervalsincenow:3];//3. Set the time, interval ln.repeatinterval = Nscale for duplicate notifications ndarunitsecond;//4. Set recurring use calendar (user-set calendar) Ln.repeatcalendar = [Nscalendar currentcalendar];//nsstring * Const NSGRE Goriancalendar; Gregorian//NSString * Const Nschinesecalendar; Lunar Calendar//Ln.repeatcalendar = [[Nscalendar alloc] initwithcalendaridentifier:nschinesecalendar];//5. Set the number in the upper-right corner of the app icon Ln.app Licationiconbadgenumber = 3;//6. Set the click Push Notification to display when the interface is loaded, load the picture ln.alertlaunchimage = @ "";//7 Set the sound effect of the notification (only the real machine is valid) Local.sound Name = uilocalnotificationdefaultsoundname;//8 Set Some additional information Local.userinfo = @{@ "QQ": @ "55555", @ "info": @ "no"};//iOS8.0 New Properties//************************************//1. Set the area to enter or leave an area when triggered//cllocationcoordinate2d coordinate = Cllocati Oncoordinate2dmake (40.1,106.1);//ln.region = [[Clcircularregion alloc] Initwithcenter:coordinate radius:10.0 identifier:@ "AB"];//2. Set accessor leave an area to execute once//ln.regiontriggersonce = yes;//***************************************//iOS8.2 new Properties//LN.ALERTTITL E = @ "Notification Header";
- Dispatching local notifications using app [UIApplication]
// 让应用调度通知 [[UIApplication sharedApplication] scheduleLocalNotification:ln];
How to send a local push notification