uilocalnotification

iOS - local notification - custom vibration or vibrate for longer duration

夙愿已清 提交于 2019-12-10 14:59:56
问题 I am trying to build an iPhone app that works like an alarm, I am using UILocalNotification Problem I would like the phone to vibrate for a longer duration. However currently it vibrates only once. Alternative Approaches Is it possible to use custom vibration patters ?(http://www.pcworld.com/article/242238/how_to_use_custom_vibrations_in_ios_5.html) Is it possible to execute a method, when the push notification is fired ? (but the app might not even be running, and yet it needs to work) Is

Launch Closed iOS App From Local Notification

て烟熏妆下的殇ゞ 提交于 2019-12-10 13:25:27
问题 When my iOS application is running in the background it responds fine to - (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification but when the application is closed it crashes and gives a SIGKILL error. How can I run a method within the app if it is closed when the notification is received? 回答1: You can't run a method in the app when a local notification is received. The notification can provide any combination of an alert, icon badge

UI Local Notification - Background Reschedule

本小妞迷上赌 提交于 2019-12-10 11:57:32
问题 I'm learning to develop application for ios with swift, and I'm one doubts, already googled and i not found. I'm creating a to-do list app, and was wondering if there is a way to reschedule a notification when it appears to the user For example the user registers a task every two hours, then the notification appears to the user and reagendo the new notification Can anyone help me? Thank you 回答1: You can't do it in background if your app is suspended. But UILocalNotification supports recurrent

iOS UILocalNotification not being displayed while app in background

非 Y 不嫁゛ 提交于 2019-12-10 10:17:15
问题 FIXED — Ok, found what it was, there was an errant [[UIApplication sharedApplication] cancelAllLocalNotifications]; being fired when I wasn't expecting it. Well there's your problem. Thanks for the help everyone, sorry to have it turn out to just be dumb coder syndrome. I've built out my local notification like so: - (void)scheduleNotification { [[UIApplication sharedApplication] cancelAllLocalNotifications]; Class cls = NSClassFromString(@"UILocalNotification"); if (cls != nil) {

How to get already fired UILocalNotification

允我心安 提交于 2019-12-10 08:12:38
问题 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

UILocalNotification custom sound

时光总嘲笑我的痴心妄想 提交于 2019-12-09 03:06:24
问题 I have been searching for a solution for hours.. with absolutely zero luck. I set up a Local Notification: UILocalNotification *notif = [[cls alloc] init]; [dateComp setDay:j+1]; [dateComp setHour:[[time objectAtIndex:0] integerValue]+offset]; [dateComp setMinute:[[time objectAtIndex:1] integerValue]]; NSLog(@"Year: %i, Month: %i, Day: %i, Time:%i:%i\n",[dateComp year], [dateComp month], [dateComp day], [dateComp hour], [dateComp minute]); notif.fireDate = [gregorian dateFromComponents

Set timeout for UILocalNotification (remove it from lockscreen and notification center after some time)

两盒软妹~` 提交于 2019-12-08 18:14:47
问题 I would like to set a UILocalNotification that will disappear from the lock screen and the notification center after five minutes (if the user won't tap on it). Can I set a timeout for the notification? Or maybe fire another notification that will delete it? 回答1: Disclaimer: The code will work only if you wake the app. In my case this code is called from application(_:handleActionWithIdentifier:for:completionHandler:) , which is triggered from a local notification, which in its turn is called

Actions buttons not showing up in local notifications ios 9.2 swift 2

假如想象 提交于 2019-12-08 16:51:32
I am creating notifications in a loop, relevant code is: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { appDelegate = self serNotificationType = UIUserNotificationType.Alert.union(UIUserNotificationType.Sound).union(UIUserNotificationType.Badge) let completeAction = UIMutableUserNotificationAction() completeAction.identifier = "COMPLETE" // the unique identifier for this action completeAction.title = "Clear" // title for the action button completeAction.activationMode = .Background // UIUserNotificationActivationMode

Sounds in UILocalNotification louder than AVAudioPlayer at max volume

人走茶凉 提交于 2019-12-08 14:32:22
For purposes of this question, imagine my app plays an audio clip every 10 seconds. This audio plays/mixes with the iPod music player on the device (using ducking), using AVAudioPlayer. When the app is sent to the background, I schedule UILocalNotification objects with the audio file referenced (and no text), so the sounds continue to play at 10 second intervals. What is bothering me is that the volume of the audio clips played as part of a notification on iOS 6 seem to be twice as loud as the audio when I play in my app (and I'm setting the volume to 1.0f, which the docs say is max). So every

UILocalNotification : updating BadgeNumber during repeatInterval

*爱你&永不变心* 提交于 2019-12-08 12:25:05
问题 After goggling for 2 days i couldn't find any solution as if its clear to everyone (but me) ! I need the: Alert.applicationIconBadgeNumber = x to be updated in background each time the notification fires, I am repeating the notify by: notif.repeatInterval = NSMinuteCalendarUnit Repeating is working fine every 1 m. when the app goes in background, but the BadgeNumber dosent get updated, it takes the 1st updated date value only. I am calling the scheduleNotification method by viewDidLoad Here