uilocalnotification

Fire local notification every day on different times

允我心安 提交于 2019-12-12 05:00:48
问题 I'm developing a project that notifies the user every day on a different time from a pre-defined database, five times a day to be precise. My problem is how schedule all these times, 5times*365days = 1825 fire dates !! is it possible to schedule them all? any ideas would be very much appreciated 回答1: According to Apple documentation: An application can have only a limited number of scheduled notifications; the system keeps the soonest firing 64 notifications (with automatically rescheduled

Keep UILocalNotification Banner visible while app is in background

懵懂的女人 提交于 2019-12-12 04:47:57
问题 I'm working on a VoIP phone for iOS, and if a call comes in while running in the background, I do a presentLocalNotificationNow with a UILocalNotification message to inform the user. This works fine, however the banner expires and rolls off the screen before the user has enough of a chance to swipe and answer. I have tried scheduling further notifications at regular intervals, but that fills up the notification centre and causes the banner to appear to be tumbling. Is there some way to

UNCalendarNotificationTrigger - Execute after the hour

青春壹個敷衍的年華 提交于 2019-12-12 04:34:39
问题 Good Morning Sirs I know using UNCalendarNotificationTrigger this way: var dateComponents = DateComponents() dateComponents.hour = 10 dateComponents.minute = 30 let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true) Every day at 10:30 a notice will be delivered. My question is whether the user opens the applications or calls after that time, if the notification will be delivered anyway. 回答1: Local notifications, once created and scheduled, have nothing to do

Cancel a local notification and schedule a new one

大兔子大兔子 提交于 2019-12-12 04:10:42
问题 I have a problem. I have local notifications in my project, here is the code (thanks @leoDabus): import UIKit class ViewController: UIViewController { @IBOutlet var datePicker: UIDatePicker! @IBOutlet var notificationSwitch: UISwitch! let localNotification = UILocalNotification() override func viewDidLoad() { super.viewDidLoad() setUpNotificationsOptions() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } override func viewDidAppear(animated: Bool) { guard let

IOS/Objective-C: Get list of pending notifications from notification center

谁都会走 提交于 2019-12-12 04:09:26
问题 I am trying to get list of local notifications for my app that are in the notification center so I can display these in the app. I found this code in this SO answer but it is in Swift. Can anyone translate to Objective-C or suggest how to get the notifications that have fired but are pending in Objective-C? if #available(iOS 10.0, *) { UNUserNotificationCenter.current().getPendingNotificationRequests { (requests) in print("here are the iOS 10 notifs \(requests)") } } else { let requests =

Local Notification every 2 week

烂漫一生 提交于 2019-12-12 02:38:47
问题 link1 link2 If I want to set local notification to repeat every 2 week than how to achieve this? I have read several questions and answers here, they have mention to reschedule local notification but how to reschedule local notification while application is in background ? I will appreciate any help on same. Thanks. 回答1: To reschedule UILocal Notification use this , NSDateFormatter *dat= [[NSDateFormatter alloc]init]; [dat setLocale:[NSLocale currentLocale]]; [dat setTimeZone:[NSTimeZone

How to stop the LocalNotificationSound when application is opening from Device Locking screen

我只是一个虾纸丫 提交于 2019-12-11 20:58:00
问题 In my application iam using UILocalNotifications, and for that notification iam setting 30 sec audio file. Notification fired if device is UnLock state and my app is in background mode then if i click on notification bar then my app is open and notification sound is stopping. This scanario is fine. Notification fired if device is locke state and my app is in background mode then if i drag the notification then my app is open and notification sound is not stopping. In this scanario

trying to create a local notification but getting error “ cannot call value of non function type uilocalnotification ” in swift 2 [closed]

耗尽温柔 提交于 2019-12-11 12:24:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() var dateComp:NSDateComponents = NSDateComponents() dateComp.year = 2015; dateComp.month = 11; dateComp.day = 20; dateComp.hour = 0; dateComp.minute = 10; dateComp.timeZone = NSTimeZone.systemTimeZone() var

IOS:Call method when local notification is received in background

戏子无情 提交于 2019-12-11 10:36:09
问题 I know this question looks duplicate but i did not found the exact answer as per my requirement.Doing app related to medical events with Below steps followed 1) connected the app to smart watch. 2) schedule the local notifications i. e when user needs to take medicine 3) when the schedule time arrives local notification fires and delegate method is calling (did receive local notification) 4) At the time of firing local notifications i am sending message(sms) to the user from the app that he

Only let local notification appear once

早过忘川 提交于 2019-12-11 09:42:02
问题 I have a huge problem! My problem is, that I've implementet a localnotification code in my delegate. I've put in this code in didEnterBackround method. However, I get a localnotifi for each didEnterBackround. Is there a possible way that only a new notification firedate starts, if the latest was gone? Like if I have a localnotifi which fires after 5 days. When I open and close the app 5 times and wait 5 days I get 5 localnotifications. Is it possible to let the app make only one firedate and