uilocalnotification

detect unacknowledged UILocalNotifications

爱⌒轻易说出口 提交于 2019-12-07 04:01:22
问题 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

iPhone alarm using repeated local notifications

无人久伴 提交于 2019-12-07 02:46:35
问题 I'm trying to add an in-background alarm clock feature to an app I'm developing. I have read up on the UILocalNotification object and its use, and am aware that it is limited to 30 seconds of audio. I was thinking of scheduling multiple notifications (say, 5 of them) spaced 30 seconds apart to mimic continuous play, but the problem with this approach is that if the user hits Close , I won't be able to cancel any of the subsequent notifications. As far as I know, it is impossible to remove or

Local Notification sound not playing?

寵の児 提交于 2019-12-07 01:58:38
I'm having this problem with the Local notifications, they are not playing the sound. I tested with the default one and the custom one that is obviously the one I want to play but nothing! I looked and a lot of people face this problem but none of their solutions worked for me. UILocalNotification *local - (IBAction)Dateaction:(id)sender { local = [[UILocalNotification alloc]init]; local.timeZone = [NSTimeZone defaultTimeZone]; local.alertBody = [NSString stringWithFormat:@"%@ Recuerda que tienes que: %@", [[NSUserDefaults standardUserDefaults] objectForKey:@"user"], [[NSUserDefaults

iPhone UILocalNotification load specific view

喜夏-厌秋 提交于 2019-12-06 21:28:28
I have my local notification working, but when I click View to come back to the app, in the app delegate I am trying to load a specific view, but it wont take. Is this possible or not? It always just comes back to the last view viewed. When you tap "View" on the notification, it takes you back to your application, and your application shows whatever it was showing before (if it was backgrounded) or is launched. If you need to show a particular UI in response to the notification, consider implementing the <UIApplicationDelegate> method -[<UIApplicationDelegate> application

Local Notification repetation at different times

女生的网名这么多〃 提交于 2019-12-06 17:01:34
I have an app that generates prayer times (5 times a day) i want to create notfication for the 5 prayers but the issue is the times change everyday based on some calculations. Edit: The calculations are done based on GPS location so when the user changes to another city the times will be updated accordingly. I input the date,timezone, GPS coordinates into a method and I get prayer time values in (HH:mm) format for that given day/location. Now I need to setup the Notfications. I'm not sure where to set them up. here is the code #import "PrayerTimeViewController.h" #import "PrayTime.h"

UILocalNotification Problem

為{幸葍}努か 提交于 2019-12-06 15:26:24
问题 I have a local notification that I would like to fire every 5 minutes. I use: localNotif.repeatInterval = NSMinuteCalendarUnit that will have the notification happen once every minute. I can't figure out how to get this to happen every 5 minutes or whatever other >1 minutes interval. I've tried: localNotif.repeatInterval= 5 * NSMinuteCalendarUnit and that doesn't work. Can anyone help me to solve this problem. 回答1: Check out this blog http://useyourloaf.com/blog/2010/9/13/repeating-an-ios

Objective-C – UILocalNotification alertBody length

对着背影说爱祢 提交于 2019-12-06 15:09:45
I'm looking for some documentation to find the maximum length of the alertBody of a UILocalNotification before it will get clipped in either the notification center (banner) or in a popup alert. I haven't found any specific limit documented. However, you can try it out and see that the notification drop down shows about 80 characters. This is on an iPhone 5S with iOS 7.1. The notification center shows more of the message. In this case about 138 characters before it starts truncating. Of course with proportionally space fonts the number of characters depends on the width of those characters,

Why background task is ending after 10 minutes

☆樱花仙子☆ 提交于 2019-12-06 15:07:43
问题 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

Error when setting UserInfo in UILocalNotification

旧时模样 提交于 2019-12-06 15:03:23
问题 I'm trying to attach an NSManagedObjectID to a UILocalNotification but keep getting the error: Property list invalid for format: 200 (property lists cannot contain objects of type 'CFType') Here's my code (taskID is an NSManagedObjectID): // Create the new notification UILocalNotification *newNotice = [[notificationClass alloc] init]; [newNotice setFireDate:date]; [newNotice setTimeZone:[NSTimeZone defaultTimeZone]]; [newNotice setAlertBody:@"Test text"]; // Add the object ID to the userinfo

What's Wrong with my notification code?

烂漫一生 提交于 2019-12-06 14:23:38
问题 Note: there is an update below. I've asked in the previous question about specifying a minute for an hourly repeat interval. However, I had two answers asking me to try the date component, and I did. Here it is: [[UIApplication sharedApplication] cancelAllLocalNotifications]; NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ; NSDateComponents *componentsForReferenceDate = [[NSDateComponents alloc] init]; [componentsForReferenceDate setHour:hour]; [componentsForReferenceDate