uilocalnotification

Possible to Subclass UILocalNotification and Change Default “Close” Button Text and Method?

[亡魂溺海] 提交于 2019-11-28 02:23:07
问题 Searching for a way to change the "Close" button text/functionality of a UILocalNotification ... I've found that it's impossible to access/call the text/function from another object, although subclassing UILocalNotification should allow implementation method overrides ... not to mention the creation of an accessor to get/set the "Close" button text field. What do you guys think about this? What would Apple? Has anyone tried?... EDIT: 12/21/2011 12:01 PM The question that I'm asking involves

didReceiveLocalNotification not getting called after using UNUserNotificationCenter

我的未来我决定 提交于 2019-11-28 00:28:52
问题 I am scheduling local notifications. It works in iOS 9.x but since iOS 10 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification doesn't get called when app is running on iOS 10. I know that iOS has introduced new UserNotifications framework but that shouldn't stop working iOS 9 APIs. How can I resolve this issue? 回答1: As you know, iOS 10 introduced the UNUserNotifications framework to handle both local and remote notifications. Using

How to set an Alarm in iOS?

久未见 提交于 2019-11-27 22:31:12
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. George Sachpatzidis First on your xib , (or code) set the date picker mode: Time (Default is date & time) The system assumes that the firedate is the current date, and the time is the time the user have chosen. This is

How to set the repeat UILocal Notifications on the select list of Weekdays

可紊 提交于 2019-11-27 22:30:36
I have implemented UILocal Notification using the following link http://useyourloaf.com/blog/2010/07/31/adding-local-notifications-with-ios-4.html And i have modified it to set the repet Notifications on each day by using //To set the repeat notification notif.repeatInterval = NSDayCalendarUnit; For exampke ex Every day at 10.00 AM But my requirement is user needsto set the notification on selected Week Days (Monday to saturDay) why because user may have weekly holidays like (SaturDay and Sunday) / Friday - Sunday) / Some other days .. on the week offs he shouldn't fire the notifications. So

Repeating a Local Notification after every 14 days(two weeks)?

会有一股神秘感。 提交于 2019-11-27 22:29:15
问题 In my app i've to set repetitive UILocalNotification . I'm able to set repeatInterval as daily, weekly etc by doing UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.repeatInterval = NSDayCalendarUnit; // or any other calendarUnit Ok..it's fine, but i've to set repeatInterval for every 14 days. i came to know from this link that we can only use one of the NSCalendarUnit repeat intervals. So you can have a repeat interval of one minute or one hour

Triggering a specific action when the app enters foreground from a local notification in iOS? (using swift)

☆樱花仙子☆ 提交于 2019-11-27 20:24:36
问题 I am building an iOS app using the new language Swift. Now it is an HTML5 app, that displays HTML content using the UIWebView. The app has local notifications, and what i want to do is trigger a specific javascript method in the UIWebView when the app enters foreground by clicking (touching) the local notification. I have had a look at this question, but it does not seem to solve my problem. I have also come across this question which tells me about using UIApplicationState, which is good as

How can I schedule local notification for the following scenario?

三世轮回 提交于 2019-11-27 19:21:43
Experts, I have a scenario wherein I need to notify user three times a day (morning, afternoon, evening). And the timings for these notifications will be different for each day, based on database values for each date. These three notifications are configurable. Meaning user might just choose to set afternoon and evening while turning off morning notification under settings. As per my understanding I can achieve this using local notifications. I can do the following: - before the application exits, inside didFinishLaunchingWithOptions, I can check what is the next notification due, is it set

Local and Push Notifications in IOS version compatible

情到浓时终转凉″ 提交于 2019-11-27 17:53:47
I developed local Notifications in iOS 10 . It is working perfectly. But now how should i code local notifications and push notification if user is using iOS 9 and above versions. Can anyone help please? Below is code in iOS 10 import UIKit import UserNotifications @available(iOS 10.0, *) class ViewController: UIViewController,UNUserNotificationCenterDelegate { override func viewDidLoad() { super.viewDidLoad() if #available(iOS 10.0, *) { //Seeking permission of the user to display app notifications UNUserNotificationCenter.current().requestAuthorization(options: [.alert,.sound,.badge],

Test if app did become active from a UILocalNotification

♀尐吖头ヾ 提交于 2019-11-27 17:08:07
Is there a way to know if the application did become active from a local notification? I know there is a way to test if the application was launched from a local notification alert; but if it just was sitting out there the background, and received a notification? I need to run different code, when the app has become active: From a local notification. Just has become active :) Is there a way to do it? I'm afraid Sylter is incorrect. When an app enters the foreground from the background , either by a direct user action or by a user response to a UILocalNotification , it does not trigger

How can I add action buttons/actions to UILocalNotification alert?

痞子三分冷 提交于 2019-11-27 17:01:15
问题 I have a local notification scheduled in my app, and right now I get a generic cancel (cross) button as I swipe the alert to the left. I'm curious if I can add custom buttons/actions to it like on the image below? 回答1: I prepared for you some snipped code which shows notification with one button 10 second after ViewDidLoad method did shown. import UIKit class TestViewController: UIViewController { let category = UIMutableUserNotificationCategory() override func viewDidLoad() { super