uilocalnotification

UILocalNotification with various alert body

笑着哭i 提交于 2019-12-22 10:13:39
问题 How Can I repeat UILocalNotification with various alert body? For example: UILocalNotification *notif = [[UILocalNotification alloc] init]; notif.alertBody = @"Hello"; notif.repeatInterval = NSDayCalendarUnit; [[UIApplication sharedApplication] scheduleLocalNotification:notif]; By using this code the notification will be repeated daily, how can I repeat the notification daily with different alert body each day? Thanks. 回答1: You could implement the application:didReceiveLocalNotification

Repeating UILocalNotifications with Gaps

↘锁芯ラ 提交于 2019-12-22 10:13:12
问题 I have a notification that needs to repeat daily. It can be turned off by the user for specific days. Is there any easy way to accomplish this scenario using the UILocalNotification framework? Take an example of a notification that repeats daily starting on March 1st, 2011, and is disabled for March 7th, and March 23rd. The only solution I've come up with is to create: 6 non-repeating UILocation notifications for March 1st through March 6th 14 non-repeating UILocation notifications for March

iOS - Local notifications - cancelAllLocalNotifications

情到浓时终转凉″ 提交于 2019-12-22 09:50:56
问题 May be a simple question: When I call "cancelAllLocalNotifications", does it cancel notifications created by the app only or it will cancel all notifications from other apps also? 回答1: The notifications created by other apps will not be affected. From: Local and Push Notification Programming Guide "You can cancel a specific scheduled notification by calling cancelLocalNotification: on the application object, and you can cancel all scheduled notifications by calling cancelAllLocalNotifications

Local notifications are not working on device but working on simulator

假如想象 提交于 2019-12-22 09:09:42
问题 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

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

烂漫一生 提交于 2019-12-22 08:27:31
问题 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.

How to listen for notification dismissed event in iOS?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 01:43:43
问题 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

Iphone presentLocalNotificationNow not triggering alert and sound while app in background

隐身守侯 提交于 2019-12-21 21:19:41
问题 I have an App registers for location updates, running tests, sometime when I enter a region while the app is in the background I receive a alarm notification with sound. sometime I only see the notification in notification center, and i did not receive any sound and alert... What can you do to always get the sound and the alert notification ? this is what i have in my view UILocalNotification *localNotif = [[UILocalNotification alloc] init]; localNotif.fireDate = nil; localNotif.hasAction =

Is it possible to update the local notification in iPhone

爱⌒轻易说出口 提交于 2019-12-21 20:25:13
问题 I have added a local notification programmatically like below: UILocalNotification *eventLocalNotification=[[UILocalNotification alloc]init]; eventLocalNotification.fireDate=myDate; eventLocalNotification.timeZone=[NSTimeZone defaultTimeZone]; eventLocalNotification.alertBody=@"My notification"; eventLocalNotification.soundName=UILocalNotificationDefaultSoundName; Can I change the firingDate, timeZone, alertBody, or any other property? 回答1: After searching a lot over internet, I got a thing

Schedule local Notification after app was closed for 7 days

坚强是说给别人听的谎言 提交于 2019-12-21 19:29:59
问题 It was quite a bit hard to enable local notifications for my application. And yeah, I set up my project with a local notification witch I want to schedule after the app had been closed for one week. For example if the user opens the app on saturday 8th, the local notification should appear on the next saturday the 15th, but the time should changed. For example he/she closes the app at 8pm and I don't want to disturb them at 8pm next week so I want to display every notification at 6pm or

App with local notifications not appearing in Notification Center list in Settings

偶尔善良 提交于 2019-12-21 17:52:16
问题 So I just got a complaint from a user saying they were not receiving any notifications from my app. I asked them to go into the Settings app -> Notification Center and check to see if alerts from the app were toggled on. (Banners, Badge app icon, Sounds, Show in notification center, show in lock screen) Surprisingly, he mentioned that the app wasn't even in the list of apps in the Notification Center. This is weird because on my device, and all devices I've tested with, the app is listed