uilocalnotification

Can I send a Local Notification with no sound?

大城市里の小女人 提交于 2019-11-29 13:56:28
I want to have a few local notifications with no display and no sound, but only a vibration. I can get it to do no display, by simply setting alertBody to @"" , but how can I send no sound? I am thinking if I don't get a better way from you guys, that I will be able to just make a sound that is empty, add it to my project, then set soundName to that sound. But is there any sort of default way to do this? If I add a phony sound name it still plays the default notification sound. Thanks!! No you can not disable sound because UILocalNotification does not provide any option for this. So better

application didReceiveLocalNotification not fired iOS7

ぐ巨炮叔叔 提交于 2019-11-29 13:19:38
问题 The problem: - (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification is not called sometimes with iOS7. It doesn't mater how we schedule the notification: alarm.fireDate = [[NSDate date] dateByAddingTimeInterval:0.1]; [app scheduleLocalNotification:alarm]; or: [app presentLocalNotificationNow:alarm]; My thoughts: This happens in the case when the user slides before the notification alert animation is finished. And if he waits just a

How to repeat local notifications on specific days of the week (iOS Swift 3)

不想你离开。 提交于 2019-11-29 13:01:29
I am creating my first app that lets the user set alerts for themselves and then the app would send the user a local notification on the set time. The thing that I'm having trouble with now is being able to fire the local notification on specific days of the week (for example every Mondays and Tuesdays only). All the tutorials/questions that I have come across so far (like this one) have only been about scheduling the notification everyday/everyweek. The desired result that I'm trying to achieve is sort of like the iPhone's built in alarm system, where you can set an alarm to fire only on

iOS 5: Can I have my app “In Notification Center” by default?

我的梦境 提交于 2019-11-29 12:43:42
问题 I have an iPad app in the App Store whose logic relies largely on local notifications. In other words, much that happens inside the app is triggered by the delegate method application didReceiveLocalNotification. With today's release of iOS 5, I see that apps can be placed (via Settings) either "In Notification Center" or "Not In Notification Center." I haven't found anything in the new documentation so far, but I'm hoping there is a way to have my app "In Notification Center" by default,

How I can set a notification which UserNotifications Framework

混江龙づ霸主 提交于 2019-11-29 12:30:51
I can set a notification in a time interval but I don't know how make it in a specific time and date, I try this but don't work let center = UNUserNotificationCenter.current() func notificationSender(){ center.requestAuthorization([.sound, .alert]) { (granted, error) in // We can register for remote notifications here too! } var date = DateComponents() date.hour = 13 date.minute = 57 let trigger = UNCalendarNotificationTrigger.init(dateMatching: date , repeats: false) let content = UNNotificationContent() // edit your content let notification = UNNotificationRequest(identifier: "myNotification

Scheduling local notifications to repeat daily from tomorrow in Swift

六月ゝ 毕业季﹏ 提交于 2019-11-29 10:48:06
I'm trying to schedule a local notification to fire every day (i.e. repeats), at a specific time, but from tomorrow. i.e "Trigger a notifcation every day at 8pm, from tomorrow" I've been using this SO question as guidance, and I believe I am doing what it says but I am still getting a notification today when I run the following code (if I schedule the notification before 8pm for instance): func testDateNotification(){ let content = UNMutableNotificationContent() content.title = "Test" content.body = "This is a test" let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: Date()) let

Local notification while app not running

喜夏-厌秋 提交于 2019-11-29 10:35:45
问题 Is it possible to show some kind of a local notification from an app, even if the app isn't running(also not in background)? For example a daily reminder or something like that. I know that it is possible with push-notifications, but it doesn't fit for my app. 回答1: You can easily schedule local notifications, and they will be presented at the scheduled date and time regardless of the app's state. First you need to get permission from the user to present notifications, like this: func

Geolocation with local notification like reminder

可紊 提交于 2019-11-29 10:28:42
问题 i want implement geolocation notification like the app reminders. this is what i have already done: in App delegate: self.locationManager = [[[CLLocationManager alloc] init] autorelease]; /* don't leak memeory! */ [self.locationManager setDelegate:self]; [self.locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; -(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { } -(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region

Difference between NSCalendarUnitWeekOfYear & NSCalendarUnitWeekOfMonth

烈酒焚心 提交于 2019-11-29 09:26:27
I want to make a UILocalNotification repeat every week, before iOS7 I would use localNotification.repeatInterval = NSWeekCalendarUnit - except NSWeekCalendarUnit has been deprecated. The docs say: "Use NSCalendarUnitWeekOfMonth or NSCalendarUnitWeekOfYear, depending on which you mean" But I don't know what the difference is, so I don't know which one I mean. These don't appear to be documented but most likely NSCalendarUnitWeekOfYear will be a value from 1-53 (or maybe 0-52) representing the week number within the calendar year while NSCalendarUnitWeekOfMonth will be 1-5 (or maybe 0-4)

Possible to Subclass UILocalNotification and Change Default “Close” Button Text and Method?

半世苍凉 提交于 2019-11-29 09:01:52
Searching for a way to change the "Close" button text/functionality of a UILocalNotification ... I've found that it's impossible to access/call the text/function from another object, although subclassing UILocalNotification should allow implementation method overrides ... not to mention the creation of an accessor to get/set the "Close" button text field. What do you guys think about this? What would Apple? Has anyone tried?... EDIT: 12/21/2011 12:01 PM The question that I'm asking involves an understanding of oop: late/early binding, dynamic method lookup, and declared type vs. runtime type