uilocalnotification

modeling a repeating event in a database, and using UILocalNotification to fire the event

耗尽温柔 提交于 2019-12-13 17:03:01
问题 I'm not sure how this would work, but what I'd like is something similar to Apple's alarm clock that comes with the iPhone. It basically just lets you pick a time of an alarm, name the alarm, and then you can choose how often you want it to repeat (Sunday - Saturday). Based on what you choose, the alarm fires once, or at a repeated interval. In my Core Data model, I wasn't sure how to model that. If I were thinking in terms of just plain old objects, I would think I would have some alarm

UILocalNotification issue with iOS9

隐身守侯 提交于 2019-12-13 11:59:00
问题 Since iOS9, local notification aren't working properly. Sometimes users receive the notification, sometimes they just don't. My notifications are repeated daily. Any idea what might causing the issue? I saw some posts, that there's a bug in iOS9, but I'm not sure that's the reason. Here's a piece of code: NSDate *alarmDate = [date dateByAddingTimeInterval:DEFAULT_SNOOZE_DURATION * i]; UILocalNotification *localNotif = [[UILocalNotification alloc] init]; localNotif.fireDate = alarmDate;

UILocalNotification always setting the date to local timezone

不打扰是莪最后的温柔 提交于 2019-12-13 06:40:36
问题 I have a method that makes the store of a UILocalNotification: - (void)save:(NSString *)program at:(NSDate*)date { NSLog(@"date to save: %@", date); // NSLog(@"timezone: %@",[date descriptionWithLocale:[NSLocale systemLocale]]); UILocalNotification* localNotification = [[UILocalNotification alloc] init]; NSLog(@"date to fire: %@", date); localNotification.fireDate = date; NSString *s=[program stringByAppendingString:@" is now on "]; NSString *title=[s stringByAppendingString:channel];

UILocalnotification firing even after notification is cancelled

偶尔善良 提交于 2019-12-13 04:20:53
问题 The notification is firing even after it is cancelled. I tried checking cancelling method it turned out to be correct. When I cancel a notification, the notification is again fired the next day - (void)cancelNotification:(int)bookID { NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; NSLog(@"Cancelling... Before %d",[[[UIApplication sharedApplication]scheduledLocalNotifications]count]); for (UILocalNotification *notification in notifications) { int

Local Notification

两盒软妹~` 提交于 2019-12-13 04:12:00
问题 I implemented a local notification in my game app that fires up once a day for a daily bonus. It all works fine when I tap the notification banner, however, when i get in to the app from the app icon, the local notification doesn't work like it should. Here is my code: -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{ ....... ....... application.applicationIconBadgeNumber = 0; UILocalNotification *localNotif = [launchOptions

Why didrecivedlocalnotification method not working?

天涯浪子 提交于 2019-12-13 04:10:21
问题 I have an application in which i have set a local notification in my class.m file which is show below:- -(IBAction)save{ NSString *str1=[NSString stringWithFormat:@"%@",txt_date.text]; NSString *str2=[NSString stringWithFormat:@" %@",txt_time.text]; str1=[str1 stringByAppendingFormat:str2]; selected_label.text= str1; [[UIApplication sharedApplication] cancelAllLocalNotifications]; NSDate *today=[NSDate date]; NSDateFormatter* formatter_current = [[[NSDateFormatter alloc] init] autorelease];

In UILocalNotification sound set recorded audio

别说谁变了你拦得住时间么 提交于 2019-12-13 04:02:12
问题 I need your help. Actually the problem is that i want to set the recorded audio file (which is saved in application document directory) to be used as sound for local notification. I searched a lot and concluded that sound file that we have to use in local notification must be in Application Bundle. So if any idea about saving recorded audio file in Application bundle at run time will also do my task 回答1: No you can not play an audio file that is not in the bundle and you can not modify the

using timer to set local notification every X seconds

雨燕双飞 提交于 2019-12-13 03:11:07
问题 i am trying to make an alarm app by setting new local notifications every X seconds when a Set button is pressed and stopping when the user taps a Stop button. using Timer() , i am currently able to set the local notification but it doesn't repeat as I would like. it only repeats when i go into the app and back to the previous screen via the Home button. also, it only repeats once by doing that. is there any way to have the user press the Set button once and have the notifications keep firing

iOS Local Notification Action in Background

随声附和 提交于 2019-12-13 01:34:27
问题 I'm building an application that when a user receives a local notification it charges their credit card via stripe and parse, there is more to it then that but thats the start. When the notification is received inside the app everything works fine but when the notification is received outside the app the action is not complete. https://github.com/jackintosh7/Wake I would the action to be complete outside the app and also a view to be brought up when the user clicks on the notification. -

Handle UILocalNotification in UIViewController using NSNotification after the app has been terminated

有些话、适合烂在心里 提交于 2019-12-13 00:04:52
问题 I'm working with UILocalNotification and I would like to notify one of my controller that the notification has been received even if the app has been terminated. In my appDelegate I implemented this function: -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { if ([application applicationState] == UIApplicationStateInactive) { [[NSNotificationCenter defaultCenter] postNotificationName:@"localNotificationReceived" object