In my app, i have implemented functionality to check app version using bundleVersion String. Now, i want to run this function everyday at 8:00 a.m. This is kiosk based app which does not go into background. So, app would be active all the time.
I am using UILocalnotification to schedule a notification for that time. Now, my app has other UILocalnotification as well. I am not sure how can i identify notifications in app delegate didReceiveLocalNotification() method.
My method to schedule notification is below
func scheduleNotification() { //UIApplication.sharedApplication().cancelAllLocalNotifications() let notif = UILocalNotification() let calendar = NSCalendar.currentCalendar() let date = NSDate() var calendarComponents = NSDateComponents() calendarComponents = calendar.components([.Day,.Month,.Year], fromDate: date) let day = calendarComponents.day let month = calendarComponents.month let year = calendarComponents.year calendarComponents.day = day calendarComponents.month = month calendarComponents.year = year calendarComponents.hour = 8 calendarComponents.second = 0 calendarComponents.minute = 0 calendar.timeZone = NSTimeZone.systemTimeZone() let dateToFire = calendar.dateFromComponents(calendarComponents) notif.fireDate = dateToFire notif.timeZone = NSTimeZone.systemTimeZone() notif.repeatInterval = NSCalendarUnit.NSWeekdayCalendarUnit UIApplication.sharedApplication().scheduleLocalNotification(notif) } Any idea would be appreciated.