uilocalnotification

iOS 8 [UIApplication sharedApplication].scheduledLocalNotifications empty

吃可爱长大的小学妹 提交于 2019-12-17 20:20:01
问题 i'm trying to update my app to iOS 8. In a function i schedule a local notification (i've already checked that firedate and all other parts of the notification are right) in this way: [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; then i use this code to print the scheduled local notification: NSLog(@"notifications %@", [UIApplication sharedApplication].scheduledLocalNotifications ); but the array [UIApplication sharedApplication].scheduledLocalNotifications

Customizing UILocalNotification's alert

家住魔仙堡 提交于 2019-12-17 16:59:07
问题 I have to change the alertView of a UILocalNotification . How can I achieve this? 回答1: You can't customize the local notification. It's only text + 1 or 2 buttons. For further details, you can go to Apple's local and remote notifications reference library. 来源: https://stackoverflow.com/questions/4303590/customizing-uilocalnotifications-alert

How to set an Alarm in iOS?

徘徊边缘 提交于 2019-12-17 16:22:44
问题 I know this question has asked many times on StackOverflow but i couldn't able to set alarm in my app because i am very new to iOS? I am following this tutorial to set an alarm: Setting a reminder using UILocalNotification in iOS. However, it doesn't seems to be working for me. I am in need to set alarm daily lets say 5.00 PM daily. I can't use date picker for choosing the time. 回答1: First on your xib , (or code) set the date picker mode: Time (Default is date & time) The system assumes that

Find list of Local Notification the app has already set

扶醉桌前 提交于 2019-12-17 09:22:28
问题 My app allows users to set a number of reminders in the future. When the app lauches I want to know what reminders (notifications) have already been set. Can I read back the notifications I have set or do I need to store in my app (e.g. Core Data or Plist)? 回答1: UIApplication has a property called scheduledLocalNotifications which you can use. 回答2: For Swift 3.0 and Swift 4.0 don't forget to do import UserNotifications This is working for iOS10+ and watchOS3+ since the class

Ask for User Permission to Receive UILocalNotifications in iOS 8

牧云@^-^@ 提交于 2019-12-17 06:59:37
问题 I have set up local notifications in the App Delegate Using this: - (void)applicationDidEnterBackground:(UIApplication *)application { UILocalNotification *notification = [[UILocalNotification alloc]init]; [notification setAlertBody:@"Watch the Latest Episode of CCA-TV"]; [notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:5]]; [notification setTimeZone:[NSTimeZone defaultTimeZone]]; [application setScheduledLocalNotifications:[NSArray arrayWithObject:notification]]; } When I run

UILocalNotification is deprecated in iOS10

ⅰ亾dé卋堺 提交于 2019-12-17 05:40:41
问题 It may be a question in advance but I wonder what to use instead of UILocalNotification in iOS10. I am working on an app which has deployment target iOS8 so will it be ok to use UILocalNotification ? 回答1: Yes, you can use UILocalNotification , old APIs also works fine with iOS10, but we had better use the APIs in the User Notifications framework instead. There are also some new features, you can only use with iOS10 User Notifications framework. This also happens to Remote Notification, for

Get a UILocalNotification to fire every week

回眸只為那壹抹淺笑 提交于 2019-12-14 02:56:53
问题 I have set up a local notification to fire. I am wondering how to get it to repeat every week at the same time e.g., 9 AM on Monday. Here's my code so far: @IBAction func scheduleLocal(sender: UIButton) { guard let settings = UIApplication.sharedApplication().currentUserNotificationSettings() else { return } if settings.types == .None { let ac = UIAlertController(title: "Cant Schedule", message: "No Permission", preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default,

Cancel and Reschedule a Local Notification(Swift)

守給你的承諾、 提交于 2019-12-13 21:24:15
问题 I'm trying to show a local notification with a time interval of 1 day (24 hours) and its working fine but now I want to cancel notification for a specific day. I tried(today) this but it didn't seem to work. My notification is still appearing this is what I have done for cancelling the notification: let appNotification = appDelegate!.notification UIApplication.sharedApplication().cancelLocalNotification(appNotification) This is how am scheduling the notification in appDelegate : //scheduling

iOS UILocalNotification Sound

陌路散爱 提交于 2019-12-13 21:05:09
问题 Is there any way to play UILocalNotification Sound even if Sound is off. Actually I am trying to create an alarm which works even if user has turned off the sound. Or any alternative way to achieve this. 回答1: If user has put the sound to off, there is no way for the app to play the sound. User settings always have the highest priorities than the applications. 来源: https://stackoverflow.com/questions/20717957/ios-uilocalnotification-sound

Keep notification on lock screen

时光总嘲笑我的痴心妄想 提交于 2019-12-13 19:51:04
问题 How can I keep the notifications from my app on the lockscreen, until the user has interacted with it? What I mean is, even if the user unlocks the phone and than locks it again, I would like to have the notification show up again and again on their lockscreen until they finally taken an action with it. The iOS Reminders app is a great example. Thanks! 回答1: until they finally taken an action with it this would be annoying to the user to say the least. First you need a way to know if the user