uilocalnotification

Removing UILocalNotification from notification tray programmatically

喜夏-厌秋 提交于 2019-11-30 05:17:07
Is there a way to programmatically remove/dismiss UILocalNotification from Notification Tray. I am able to cancel the notification which removes the notifications from [[UIApplication sharedApplication] scheduledLocalNotifications] Here is what i need to do I need to dismiss the UILocalNotification from NotificationTray after the action has been performed(ie after the user taps the notification) EDIT: I can remove the notifications from the NSNotificationCenter . I want to remove specific notifications from the Notification Tray .Like the user presses the clear button to clear all the

How to repeat local notifications every day at different times

社会主义新天地 提交于 2019-11-30 03:58:21
I'm working on a prayers application that enables users to set an alarm(local notification) for prayer times, i.e. the user sets the application to notify him for Fajr prayer every day, the problem is that the time for each prayer changes daily so the time the app will notify the user for fair in thursday will differ from the time in friday, i need to repeat the local notification every day but according to the daily prayer time, please, could anyone give me an idea? There are a few possible solutions for this. It might be safer to use an approach where a limited number of notifications are

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

吃可爱长大的小学妹 提交于 2019-11-30 02:20:37
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 = NSLocalizedString(@"ALERT_MESSAGE", nil); localNotification.soundName = UILocalNotificationDefaultSoundName;

App lost control over local notifications after being updated from App Store

点点圈 提交于 2019-11-30 01:22:13
问题 I have an app with local notification at the App Store. In the last 4 version updates to my app, there were customers who experienced something strange - the app lost control over previous notifications, they kept getting all notification scheduled before the update, even though they should've been canceled by [[UIApplication sharedApplication] cancelAllLocalNotifications] ! While communicating with these customers, I told them to turn off reminders, something that performs

Local Notification “Everyday at 7:00am” not notifying

二次信任 提交于 2019-11-30 00:32:00
问题 I want a notification to go off everyday at 7:00, but it will not go off. I also want it to show in lock screen. Here is all the code I have so far. -(void)EveryDayNotify { NSLog(@"Good Morning Working"); UILocalNotification *localNotification = [[UILocalNotification alloc] init]; [localNotification setAlertBody:@"Good Morning! Have a great day!"]; localNotification.soundName = UILocalNotificationDefaultSoundName; localNotification.applicationIconBadgeNumber = 1; localNotification

Schedule UILocalNotification everyday at specific time

孤街浪徒 提交于 2019-11-29 22:34:18
问题 I am using below piece of code to schedule a localnotification at specific time. But the notification is repeating for every minute instead of after one day. Whether i have missed any notification settings. My timezone is (Asia/Calcutta (IST) offset 19800) and using iPhone 4s. - (void)applicationDidEnterBackground:(UIApplication *)application { NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ; NSDate *now = [NSDate date]; NSDateComponents *components = [calendar components:

Send Local Notifications while App is running in the background Swift 2.0

纵饮孤独 提交于 2019-11-29 21:12:39
问题 I am trying to send the user a 'Push Notification style' Alert when the user minimizes the app (by clicking on the iPhone's Home Button or by locking the phone as well). My app continuously parses an XML file (every 10 seconds) and I want the app to continue running so that it sends the user a Local Notification once some condition has been met in my program, even after the user has minimized the app or locked their phone. I've bounced around from tutorials and everyone seems to 'schedule' a

How to change notification type from Banner to Alert in iOS8?

江枫思渺然 提交于 2019-11-29 16:40:13
I'm trying to create an app that delivers local notifications as an Alert, not a Banner. But looks like banner is the default and I can't find a way to change it on my code. I can change it on the app notification settings and it works perfectly, but I want that configuration to be default. This is the code I use to ask the user for permission to send notifications: UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]; [[UIApplication

iOS 9 : beginBackgroundTaskWithExpirationHandler is getting called before timout

烈酒焚心 提交于 2019-11-29 16:24:54
i'm working on VOIP call and adding support to iOS < 10. For incoming VOIP call when app is in background, i'm using UILocalNotification (deprecated in iOS 10). To make a call 60 secs (or 1 minute) i'm using this code count = 0; apnTimer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(showIncomingCall:) userInfo:userInfo repeats:YES]; self.backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{ NSLog(@"ALVOIP : BACKGROUND_HANDLER_NO_MORE_TASK_RUNNING."); [application endBackgroundTask:self.backgroundTask]; self.backgroundTask =

iOS: showing an alert when getting a call?

无人久伴 提交于 2019-11-29 15:44:16
问题 I would like a local notification to be fired when a call is received (and to show an alert) - is this possible? Can a call event get an app to launch or a notification to be fired? How is skype fired? With push notifications? Thanks 回答1: If your application is running while a call is in place check out the CoreTelephony Framework. The CTCall class provides information about the call state. I have not used this myself but you may find it useful. extern NSString const *CTCallStateDialing;