uilocalnotification

Home button press , Which AppDelegate method should i use for scheduling a local notification

半世苍凉 提交于 2020-01-13 04:19:28
问题 I would like to schedule a local notification as soon as the user hits the home button. Which App delegate method should I use in this case : applicationWillResignActive applicationDidEnterBackground applicationWillTerminate Well I guess I shouldn't use the third one, but what is the difference between the first two ? Is there any way to distinguish getting interrupted by a phone call/other notification and actually pressing the home button ? Thanks in advance. 回答1: To schedule local

Home button press , Which AppDelegate method should i use for scheduling a local notification

元气小坏坏 提交于 2020-01-13 04:19:26
问题 I would like to schedule a local notification as soon as the user hits the home button. Which App delegate method should I use in this case : applicationWillResignActive applicationDidEnterBackground applicationWillTerminate Well I guess I shouldn't use the third one, but what is the difference between the first two ? Is there any way to distinguish getting interrupted by a phone call/other notification and actually pressing the home button ? Thanks in advance. 回答1: To schedule local

UILocalNotification in sleep mode on iPhone

╄→гoц情女王★ 提交于 2020-01-11 11:28:26
问题 I'm developing a Voip application. When I press the lock button(app goes to sleep), and the server sends a request I present a local notification. The local notification is presented as it should and The button slider text says "slide to answer". If I slide here, the app gets open. However, if now I press again the lock button, and then unlock, the notification is still presented and the slider text has changed to "slide to unlock". Now, when I slide to unlock, it's as if I pressed the "close

Cancel local notification not working

天涯浪子 提交于 2020-01-11 02:21:26
问题 I've spent half of my day reading all "How to cancel a local notification" questions and answers. After all, I came up with my own solution but apparently it is not working. I have a tableview with all my scheduled notifications.... on the H file I have @property (strong, nonatomic) UILocalNotification *theNotification; and then on the M file: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *notificationArray = [[UIApplication

How to increment application badge number for recurring local notification (iPhone)

青春壹個敷衍的年華 提交于 2020-01-10 11:08:11
问题 I've setup a local notification that repeats every minute, however I need the application badge number to increment each time. When I run it at the moment it doesn't seem to increase, it just stays a 1. Please can someone help me out? Here is how I create the notifications: // Create the UILocalNotification UILocalNotification *myNotification = [[UILocalNotification alloc] init]; myNotification.alertBody = @"Blah blah blah..."; myNotification.alertAction = @"Blah"; myNotification.soundName =

UILocalNotification is supposed to repeat every weekday, but fires on weekends as well

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-10 07:58:13
问题 I have a UILocalNotification that is supposed to fire once a day, Monday through Friday, but not on the weekend. I thought that setting the repeatInterval property of the notification to NSWeekdayCalendarUnit would accomplish this. Sadly for me, my notifications are still firing on the weekend. Can anyone suggest why? Here is my code: UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.alertAction = @"View"; localNotification.alertBody =

How to set notifications listed under settings -> notifications?

爱⌒轻易说出口 提交于 2020-01-07 06:33:16
问题 i have an app that is using local notifications, and its working all fine, it is generating notifications very well, now i want to turn it off from settings but its not been listed under settings -> notifications any idea? 回答1: You can design your own Settings.bundle and you application settings will appear in Settings -> Applications -> Your app And in your application you can change this setting and handle it in your app to stop generating local notifications. 回答2: Only push notification

Strange date picker behaviour Xcode, swift 3

隐身守侯 提交于 2020-01-07 03:52:19
问题 My current project is a timer which uses a date picker to set the amount of time the user wants before the timer goes off (say 1 minute, 6 hours and two minutes etc.). The problem lies in the amount of time that the date picker believes it has been set for. Below is the code which I am using to set the time. @IBOutlet weak var datePicker: UIDatePicker! var timeAmount:Double = 0 @IBAction func startButton() { timeAmount = Double(datePicker.countDownDuration) let trigger =

Determine if local notification is allowed

血红的双手。 提交于 2020-01-06 08:15:26
问题 How to detect local(not push notification) notifications are allowed or not ? I'm going to integrate local notifications with my app, and for app functionality is very important to detect are local notifications allowed or not. 回答1: Local notifications are always allowed and are available as any other functionality in iOS SDK. Push notifications, however, require special signature for the app to work. Read more about that in Developer docs. If your app is frontmost and requires to respond to

how to set array of date to fireDate in local notification at a time

不想你离开。 提交于 2020-01-06 02:18:45
问题 Actually in my app I'm starting more than two timers at different times. After certain time intervals I want notifications to fire. It's working fine when the app is on foreground but not in the background. How can I solve this? Please help. Thanks! 回答1: You need to do following... You need to turn on background mode. In AppDelegate, Add this code to run app in background Create a property @property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTask; and then do following... -