uilocalnotification

UILocalNotification Problem

爷,独闯天下 提交于 2019-12-04 20:50:35
I have a local notification that I would like to fire every 5 minutes. I use: localNotif.repeatInterval = NSMinuteCalendarUnit that will have the notification happen once every minute. I can't figure out how to get this to happen every 5 minutes or whatever other >1 minutes interval. I've tried: localNotif.repeatInterval= 5 * NSMinuteCalendarUnit and that doesn't work. Can anyone help me to solve this problem. Check out this blog http://useyourloaf.com/blog/2010/9/13/repeating-an-ios-local-notification.html Has a tutorial on how to repeat notifications with an xcode project. Also maybe it is

UILocalNotifications playing Custom sound

丶灬走出姿态 提交于 2019-12-04 18:56:22
问题 I implemented local notification in my app but I am just wondering is there a way to play a sound that is not part of the main bundle of iPhone App. Basically in my app, I want user to record a sound that gets played when the local notification is generated instead of playing a pre-recorded or default sound. As far as i know this can be implementable because i have seen 2-3 App in app store which is doing the same thing which i want to do - (void)alertSelector:(NSString *)AlertTitle

What's Wrong with my notification code?

给你一囗甜甜゛ 提交于 2019-12-04 18:47:54
Note: there is an update below. I've asked in the previous question about specifying a minute for an hourly repeat interval. However, I had two answers asking me to try the date component, and I did. Here it is: [[UIApplication sharedApplication] cancelAllLocalNotifications]; NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ; NSDateComponents *componentsForReferenceDate = [[NSDateComponents alloc] init]; [componentsForReferenceDate setHour:hour]; [componentsForReferenceDate setMinute:0]; [componentsForReferenceDate setSecond:0]; NSDate *fireDateOfNotification = [calendar

UILocalNotification end date

孤人 提交于 2019-12-04 18:41:49
I wonder if it's possible to set end date for UILocalNotification ? I want my notification to fire everyday ( NSDayCalendarUnit ) but I have end date which I cannot cross (deadline) e.g. I'm taking a photo of my growing mustache everyday for one year period and after a year notifications won't be displayed. I hope you got my point of view... There is not such option in UILocalNotification as you can read in the documentation. Your only option is to check wether the year is over when every the user starts the app. In the UILocalNotification object, I'd recommend setting the repeatInterval

iOS limitation of 64 local notifications

为君一笑 提交于 2019-12-04 17:51:47
I know that this topic is a duplicate, but I need your help. It is very important for me and the other posts have no really an solution for me. I have an app (Swift 2) where the user can save entries in core data. These entires will show in a table view. The user has to set an reminder date (with a date picker) for each entry. This date will use for the fire date of the local notification. Each entry get 2 local notifications First fire date: 1 week before the chosen date, second fire date: chosen date The problem is the Apple limitation of 64 local notifications. The user can only save 32

cancelAllLocalNotifications not working in iOS10

☆樱花仙子☆ 提交于 2019-12-04 17:49:53
问题 I want to remove all previous local notification from NotificationCenter when adding new notifications. But it is working in iOS9.0 and lower version but in iOS 10 it fires multiple local notifications. So it seems like cancelAllLocalNotifications not clearing notifications. Code compile successfully in iOS10. UIApplication.shared.cancelAllLocalNotifications() 回答1: For iOS 10, Swift 3.0 cancelAllLocalNotifications deprecated from iOS 10. @available(iOS, introduced: 4.0, deprecated: 10.0,

Local Notification every specific day of week

跟風遠走 提交于 2019-12-04 17:39:32
I need to create a local notification for a specific time (example at 18.00) fired every working day of week (not Saturday and Sunday) but I can't find examples or tutorial. I want use with swift2.1. How can I create this notification? My problem is define the firedate correctly of the notification You can use NSDateComponents to create the exact date for your local notification. Here is the example, how do we create local notification with exact fire date: NSDate *now = [NSDate date]; NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *components = [calendar components

Receive local notifications after deleting and reinstalling an iphone app

主宰稳场 提交于 2019-12-04 17:36:49
问题 I am using UILocalNotification in my project. I am stuck with an issue using the UILocalNotifications . If I schedule notifications for a week, delete the app and re install with no notification scheduled from the re-installed app, I receive the notifications for the times that were scheduled previously. Even if there are no notifications scheduled from the present install, I receive the notifications. Is there a way to unschedule/remove these notifications? 回答1: Actually, when you schedule

How to check Notification alert style for our app?

廉价感情. 提交于 2019-12-04 15:29:00
What exactly I wanted is to change the Notification Alert Style to "Alerts" But came to know that we can't do it programatically. Now lets come to the Scenario, I have a UILocalNotification set with the repeatinterval = kCFCalendarUnitMinute . So each minute it shows new notification in the notification Window if I don't cancel it. Now Say, I have kept the device idle for 10 minutes then I will be bombarded with 10 notifications though I have set a single notification with repeatinterval. MAIN QUESTION: Is there any way that only the last notification is displayed. Like I have given the

How to respond to local notification when app is closed in iOS10?

…衆ロ難τιáo~ 提交于 2019-12-04 14:31:44
How to respond to local notification when app is completly closed (not in background)? When the app is running in the background or foreground everything works fine. But when the app is closed and I'm trying to answer to a notification, only "application didFinishLaunchingWithOptions" gets called, "userNotificationCenter didRecive response " isn't answering. I found this question ( How to handle UNNotificationAction when app is closed? ) but in my case it doesn't work neither at a real device nor in a simulator. I also noticed that the function "UNUserNotificationCenter.current()