uilocalnotification

How to get already fired UILocalNotification

ぃ、小莉子 提交于 2019-12-05 14:25:31
I'm implementing UILocalNotification in my app, and the notifications are delivered as expected. As I have understood, the notifications are handled like this: When the application is not running, and the user click the notifiction, the app receives the notification through the options in the applicationDidFinishLaunching method. When the application is active, it receives the notification through the didReceiveLocalNotification method. When the application is in the background, and the user clicks the notification, it receives the notification through the didReceiveLocalNotification method.

How can I act on Core Data iCloud sync notification when the app is in the background?

有些话、适合烂在心里 提交于 2019-12-05 13:01:28
I have an iOS app that uses Core Data with iCloud sync. The app is working perfectly and syncing across multiple devices. As part of my implementation my app is registered for the: NSPersistentStoreCoordinatorStoresDidChangeNotification This notification works perfectly with the app in the foreground, but what I would like to do is fire a local notification to let the user know that the iCloud data in the app has changed, whenever the app is in the background and a sync notification comes in. I was under the impression that iCloud Core Data syncing continued in the background, but I am having

Local notifications are not working on device but working on simulator

人走茶凉 提交于 2019-12-05 12:50:46
I've read some guides of how to use UILocalNotification 's. So I've tried and haven't succeed since my first try. To register notifications in AppDelegate.m I use: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... //if it is iOS 8 if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge|UIUserNotificationTypeAlert|UIUserNotificationTypeSound) categories:nil]; [application

Multiple Local Notification in iPhone

半城伤御伤魂 提交于 2019-12-05 07:33:49
问题 In my app, I have list of friends say: 3 friends, all these three have birthday details. I need to schedule local notification to show their b’days alert. I know and handled a local notification but how will I handle these multiple notification? I am setting fire date in "for loop”.Is it proper, See the code. UILocalNotification *localNotif = [[UILocalNotification alloc] init]; if (localNotif == nil) return; NSDateFormatter *formatter = [[[NSDateFormatter alloc]init]autorelease]; for (int i =

Activate local notification based on time in the background

会有一股神秘感。 提交于 2019-12-05 06:54:42
问题 So I have an app that includes repeat intervals local notification and I would like to add a feature that will pause the notifications during sleep time. So far, I have created two datepickers for the user to spicify what time they would like to stop the repeat interval and what time to restart again automatically. And I have added a uiswitch for them to activate the sleep mode or ignore the feature. Now, how would I make my main uipickerview -( which they choose there notification from here)

detect unacknowledged UILocalNotifications

柔情痞子 提交于 2019-12-05 06:09:21
It seems that didFinishLaunchingWithOptions:(NSDictionary *)launchOptions and didReceiveLocalNotification:(UILocalNotification *)notification are only triggered if the user acknowledges the UILocalNotification, for example by swiping the slider or touching the entry in iOS's Notification pull-down. Is there any way to tell that a UILocalNotification has gone off if the user ignores the UILocalNotification and re-enters the app by simply clicking on the app icon? I should mention that this really only applies to repeating notifications because the firing of non-repeating notifications can be

Detect next UILocalNotification that will fire

夙愿已清 提交于 2019-12-05 01:52:53
问题 Is there a way to find the NSDate for the next local notification that will fire? For example, I've set up three local notifications: Notification #1: Set to fire yesterday at 3:00 PM with repeat interval of daily. Notification #2: Set to fire today at 5:00 PM with repeat interval of daily. Notification #3: Set to fire tomorrow at 6:00 PM with repeat interval of daily. Given that is is currently 4:00 PM, the next local notification that will fire is notification #2. How can I retrieve this

How to listen for notification dismissed event in iOS?

﹥>﹥吖頭↗ 提交于 2019-12-04 23:12:19
I am listneing to actions pressed for my local notifications, but is there a way to determine when the user dismisses a notification? Here is how I'm listening to my actions in my AppDelegate, but the dismiss doesn't fire this: func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) { var actionName: String? = nil if let identifier = identifier { switch identifier { case "snoozeAction": actionName = "snoozeActionTapped" break default: break } if let name = actionName {

Why background task is ending after 10 minutes

混江龙づ霸主 提交于 2019-12-04 21:02:52
I am badly in need of a background task to run always, when application is in background. It is needed for a voip application. All steps are done for voip app. I am using following script to run background task - (void)applicationDidEnterBackground:(UIApplication *)application { UIApplication *app = [UIApplication sharedApplication]; UIBackgroundTaskIdentifier bgTask; self.bgTask = [app beginBackgroundTaskWithExpirationHandler:^{ [app endBackgroundTask:self.bgTask]; }]; } After using it, when application goes to background, within 10 minutes if a sip call comes UILocalnotification appear. but

UILocalNotification Twice every day

穿精又带淫゛_ 提交于 2019-12-04 21:01:09
I want to fire local notification twice everyday like for ex:- morning 7am and evening 6pm everyday so can anyone please help me how can i do that? unable to set custom time to fire the local notification have looked every where but nothing helpful for fire local notification twice in a day if any help will appreciate graetly Thanks in advance :) this is the peace of code i am using local notification but it's not firing at all :( - (void)scheduleNotification { [[UIApplication sharedApplication] cancelAllLocalNotifications]; Class cls = NSClassFromString(@"UILocalNotification"); if (cls != nil