uilocalnotification

UILocalNotification not firing

六月ゝ 毕业季﹏ 提交于 2019-12-04 12:28:17
I am very new to Cocoa Touch and Objective-C but I've gotten the pretty big points down and I am experimenting with the UIKit. I have a action linked to a button that changes a label and fires a UILocalNotification and this is the action method: - (IBAction)changeLabel:(id)sender { self.LabelOne.text = @"WHAT UPPP!"; self.NotifyOne.alertBody = @"Testtttttt"; self.NotifyOne.alertAction = @"Got It."; self.NotifyOne.fireDate = nil; } There are no errors or warnings, but it's just not firing. Is there anything wrong with my action method? UPDATE Here is the App Delegate initialization that

scheduleLocalNotification doesn't work for jailbreak apps?

前提是你 提交于 2019-12-04 11:43:56
I have an app that calls scheduleLocalNotification , but it doesn't work when I install it to /Applications instead of /var/mobile/Applications : - (void) doNotify { // this doesn't work when app is in /Applications but does in /var/mobile/Applications UILocalNotification * theNotification = [[UILocalNotification alloc] init]; theNotification.alertBody = @"Finished processing."; theNotification.alertAction = @"Ok"; theNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:1]; [[UIApplication sharedApplication] scheduleLocalNotification:theNotification]; NSLog(@"notification scheduled: %@

Home button press , Which AppDelegate method should i use for scheduling a local notification

半城伤御伤魂 提交于 2019-12-04 11:21:51
I would like to schedule a local notification as soon as the user hits the home button. Which App delegate method should I use in this case : applicationWillResignActive applicationDidEnterBackground applicationWillTerminate Well I guess I shouldn't use the third one, but what is the difference between the first two ? Is there any way to distinguish getting interrupted by a phone call/other notification and actually pressing the home button ? Thanks in advance. To schedule local notification you shold use applicationDidEnterBackground instead of using applicationWillResignActive because

Schedule local Notification after app was closed for 7 days

僤鯓⒐⒋嵵緔 提交于 2019-12-04 11:14:09
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 something like that. Now you know my problem and here is my code I'm using: - (void

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

若如初见. 提交于 2019-12-04 10:39:50
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 under Notification Center and notifications work fine. How could this possibly happen? Also, keep in mind

Show alert on screen when app is in background

隐身守侯 提交于 2019-12-04 09:53:10
I want to show multiple alerts after some time interval when the app is in background. Currently I am using local notification to show the alert but I cannot detect action when user presses the cancel button of local notification. UILocalNotification *localNotif = [[UILocalNotification alloc] init]; if (localNotif == nil) return; localNotif.fireDate = [NSDate date]; localNotif.timeZone = [NSTimeZone defaultTimeZone]; // Notification details localNotif.alertBody = @"This is local notification message."; // Set the action button localNotif.alertAction = @"View"; localNotif.alertAction = @"Yes";

how to identify a particular notification in ios sdk

这一生的挚爱 提交于 2019-12-04 09:17:13
问题 actually am developing an alarm project, now i have a doubt on Local notification. how can i identify a particular notification. we can't even set tag to local notification then how can i differentiate them. example: notification:1 UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = selectedDate; localNotification.alertBody = @"you got work"; localNotification.alertAction = @"Snooze"; localNotification.repeatInterval = NSDayCalendarUnit;

UILocalNotification play sound from app documents

谁说我不能喝 提交于 2019-12-04 08:19:52
I know that UILocalNotification supports soundName only from app bundle, but I saw program that plays my recorded sound in Notification, even if program is closed. How to implement it? Any ideas is very important for me.. A surefire way to get an NSURL to the application documents directory is like this... NSURL *documentsDirectoryURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; Then you can get an NSURL reference to your sound file like this... NSURL *soundURL = [documentsDirectoryURL URLByAppendingPathComponent:@"sound.caf"]

How to Run a Task in swift on a particular date-time in background either application is on or off

戏子无情 提交于 2019-12-04 07:32:14
I am working on alarm application, i need to schedule alarm on specific time, I use scheduleLocalNotification for scheduling alarms and it's working fine as i want. BUT I need to run to a request to my API server before triggering alarm. In that request I want to check some parameters returning from API server, If that satisfies some condition. If any one have a method that run on a particular date - time in swift Please help me for that func addAlarm (newAlarm: Alarm) { // Create persistent dictionary of data var alarmDictionary = NSUserDefaults.standardUserDefaults().dictionaryForKey(ALARMS

UILocalNotification fires after reinstalling the app

喜你入骨 提交于 2019-12-04 05:33:48
My app has an alarm function using UILocalNotification, and it works great. However, if the user uninstalls the app, then later REINSTALLS it, he would receive all the "in between" notifications at once. I have tried to call: [[UIApplication sharedApplication] cancelAllLocalNotifications]; if it's the first time the app is launched, but it doesn't help, because the notification is received even before application:didFinishLaunchingWithOptions: is called. This was worse in 4.0 when the alarm was repeated even if the user has deleted the app, but at least that bug was fixed by Apple in later