uilocalnotification

Can I have custom UILocalNotification repeat intervals (i.e. weekdays only?)

大憨熊 提交于 2019-12-10 23:37:51
问题 I would like to be able to schedule a UILocalNotification to repeat at the same time every day, but only on weekdays (no Saturdays or Sundays). Is this possible using the repeat interval feature of UILocalNotification, or is my only option to create some kind of class that handles the time and date and works out when to schedule (several) notifications in advance? Thanks in advance. 回答1: Yes, this is possible. Set the repeatInterval of the UILocalNotication to NSWeekdayCalendarUnit . Here's a

Manage Multiple UILocal Notification

北城余情 提交于 2019-12-10 23:07:29
问题 I have created multiple UI local Notifications , say 100. I have an array of UILocalNotifications which are scheduled as: -(void) scheduleNotification{ AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [[UIApplication sharedApplication] cancelAllLocalNotifications]; [self.notifications removeAllObjects]; for (int i = 0; i< [delegate.viewController.contactList count] ; i++) { UILocalNotification

Can I set UILocalnotification to repeat every last day of every month?

≡放荡痞女 提交于 2019-12-10 19:08:50
问题 I want to try this myself, but it would take a month before I can sure it work. Any one have ever try this ? NSDate *fireDate = // Date I want to repeat, in this case 31 may localNotification.fireDate = fireDate; localNotification.repeatInterval = NSMonthCalendarUnit; [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; I expected it to alert on the last day of every month. Is this a way to go ? And if I schedule it on 30-day month and the next day is 31-day month

iOS - How can I tell if a Local Notification caused my app to enter foreground?

╄→гoц情女王★ 提交于 2019-12-10 18:44:16
问题 I have code within my app delegate's application:didReceiveLocalNotification: method to display an UIAlertView for that local notification, whenever my app is in the foreground. If my app is within the background when the local notification arrives the user gets presented with the notification and is able to launch the app by selecting it. In this case my app comes to the foreground my App Delegate's applicationWillEnterForeground: is called. Afterwards though my didReceiveLocalNotification

UILocalNotification NSLocalizedString uses language of device

こ雲淡風輕ζ 提交于 2019-12-10 17:57:26
问题 We have a localized app. Lot of users in the Netherlands have their device set to English and as second language to Dutch. We have a language selection menu in our app because 99.9% of the users wants dutch traffic information and not English. Therefor we set the language to Dutch if one of the preferred language is Dutch. This works great except for UILocalNotifications and the device language is English (second one is Dutch). Our app language is Dutch (but should be the same for any other

Notification extension access Core Data

↘锁芯ラ 提交于 2019-12-10 17:55:27
问题 I am trying to send a local notification with custom UI that shows the user more content than the notification itself contains. I want to get the content from the app's core data. Is it possible? When I debug the notification content extension it crashes on the following line where the core data model path is retrieved: let modelURL = NSBundle.mainBundle().URLForResource("Model", withExtension: "momd")! Also, when I print(NSBundle.allBundles()) from the notification extension code, it prints

How to update body of repeated local notification in iOs 10?

北战南征 提交于 2019-12-10 17:35:32
问题 I created a local notification with Swift 3. The problem is that I want to change the body of local notification. For example: - There are 15 left issues . 20 minutes later: - There are 10 left issues . Can anybody help me, please? 回答1: After research I can almost confirm that it is not possible to update the repeated notification without app being foreground. When you schedule a repeated push notification, the title and body is already set. In order to change the tile and body we will need

iOS - Need to distinguish UILocalNotification in application:didReceiveLocalNotification:

我怕爱的太早我们不能终老 提交于 2019-12-10 16:44:21
问题 So here's the deal... I need a way to distinguish from what application state I received a UILocalNotification . There is one scenario that for me I don't understand. That is when the app is currently running in the foreground and the user pulls down the Notification Center (iOS 5) then the app will get called applicationWillResignActive: which is perfectly logical because it will not be active when the Notification Center will be displayed over it. But I would suspect that also

Schedule a local notification for a specific time in Swift 2

[亡魂溺海] 提交于 2019-12-10 16:08:24
问题 I've been all over these forums and other sites and I keep getting pieces of an answer that don't add up. Essentially, I would like to create a notification that fires, for example, every weekday at 6:28 AM, 12:28 PM, and 5:28 PM. I have pieces of a solution, but I'm really unsure where to go. Am I setting this up right at all? Any help is appreciated. let notification: UILocalNotification = UILocalNotification() notification.category = "News and Sports" notification.alertAction = "get caught

Stop UILocalNotification Sound on slide to view

半腔热情 提交于 2019-12-10 15:13:57
问题 In my alarm app, I am scheduling an alarm on some time. With the app in foreground I lock my iPhone (iOS7, I haven't tried with iOS6). Now when the notification sound starts, I view the local notification by using the "Slide to view" on my lock screen, and when the app opens, I also play the sound using AVAudioPlayer . So the problem is notification sound continuously ringing until 30.0 seconds. Is this iOS issue or in the code I need to integrate any method etc.? Thanks 回答1: according to