uilocalnotification

Is there a way to know when an app is deleted in iOS?

风流意气都作罢 提交于 2019-12-03 12:21:47
问题 my problem is this: I have scheduled some UILocalNotifications on an iOS app, the problem is that if I delete the app without deleting the objects associated with the notifications (and consequently removing the notifications from the scheduledNotifications array) the notifications still fire. Although I have not experienced them actually firing (they are set to repeat within a week's interval) I have evidence of this since I NSLog the scheduledNotifications array at application launch, which

How can I access default iOS sound to set it as notification sound?

老子叫甜甜 提交于 2019-12-03 12:10:42
问题 How can I access default iOS sound (Tri-tone, Chime, Glass, Horn, Bell, Electronic...) to set it as local notification sound? I've created local notification, everything works but with default sound (which is Tri-tone). I want to use Chime or another I only know how to use my own sound files: localNotif.soundName = @"sound.wav"; 回答1: check out this site. If you want to play a Default System Sound. refer a following code, but private Frameworks. you will be rejected.

Receive local notifications after deleting and reinstalling an iphone app

╄→гoц情女王★ 提交于 2019-12-03 11:08:06
I am using UILocalNotification in my project. I am stuck with an issue using the UILocalNotifications . If I schedule notifications for a week, delete the app and re install with no notification scheduled from the re-installed app, I receive the notifications for the times that were scheduled previously. Even if there are no notifications scheduled from the present install, I receive the notifications. Is there a way to unschedule/remove these notifications? Actually, when you schedule future notification, then delete app and then again re-install it, in this case you will receive previously

Show an image in the alert body of a local notification

送分小仙女□ 提交于 2019-12-03 09:08:11
I am using Local Notifications, but I want to put an image in the message body of the alert. How can I do that? KingofBliss I also searched for the same question . And found that we can't customize the UILocalNotification , so I handled this in application:didReceiveLocalNotification: by showing custom UIAlertView . This should work. Give it a whirl: UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 40, 40)]; UIImage

How to delete all local notifications when an application is deleted from an iPhone

只谈情不闲聊 提交于 2019-12-03 09:08:09
问题 Let's say I set 5 local notification for an iPhone application, then the user deletes the app. If the app is installed again, it shows the previous notifications. I know the following code deletes all notifications [[UIApplication sharedApplication] cancelAllLocalNotifications]; But where do I put that code so that it executes when the application is deleted? Or any other way to solve this problem. 回答1: As others have mentioned, I think the best way to accomplish this is to have a flag in

How to set sound local notification from song in iTunes?

帅比萌擦擦* 提交于 2019-12-03 07:13:17
I try to create alarm app but I don't know how to set song from iTunes to sound of local notification. Now I use this code to call iTunes - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = NO; picker.prompt = NSLocalizedString (@"Select any song from the list", @"Prompt to user to choose some songs to play"); //[self presentModalViewController: picker

Trying to implement beginBackgroundTaskWithExpirationHandler and UILocalNotification

五迷三道 提交于 2019-12-03 06:51:41
I have the following code in my AppDelegate for when my application enters the background: var backgroundUpdateTask: UIBackgroundTaskIdentifier! func beginBackgroundUpdateTask() { self.backgroundUpdateTask = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler({ self.endBackgroundUpdateTask() }) } func endBackgroundUpdateTask() { UIApplication.sharedApplication().endBackgroundTask(self.backgroundUpdateTask) self.backgroundUpdateTask = UIBackgroundTaskInvalid } func doBackgroundTask() { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { self

iOS UILocalNotification - No delegate methods triggered when app is running in background and the icon is clicked upon notification

非 Y 不嫁゛ 提交于 2019-12-03 05:06:36
问题 iPhone version - 5.1 (9B176) Below is the series of events during Local Notification where in which didFinishLaunchingWithOptions method is not invoked. App is running in background. Got local notification - simple notification no dialog. Click on the app icon which shows the badge number. Expected as per Apple documentation: As a result of the presented notification, the user taps the action button of the alert or taps (or clicks) the application icon. If the action button is tapped (on a

Check for launching from UILocalNotification in Swift

倾然丶 夕夏残阳落幕 提交于 2019-12-03 03:31:32
This is a follow-up question to How to check launchOptions in Swift? - I got my app to launch successfully without crashing, but I can't seem to correctly detect when the app is launching from a notification vs a normal launch. I am creating my UILocalNotification like so: // set up a frequently recurring notification here just for testing... var fast = UILocalNotification() fast.fireDate = NSDate(timeIntervalSinceNow: 15) fast.alertBody = "Alert Message" fast.timeZone = NSTimeZone.localTimeZone() fast.repeatInterval = NSCalendarUnit.CalendarUnitMinute fast.userInfo = ["Important":"Data"]

Is there a way to know when an app is deleted in iOS?

好久不见. 提交于 2019-12-03 02:57:29
my problem is this: I have scheduled some UILocalNotifications on an iOS app, the problem is that if I delete the app without deleting the objects associated with the notifications (and consequently removing the notifications from the scheduledNotifications array) the notifications still fire. Although I have not experienced them actually firing (they are set to repeat within a week's interval) I have evidence of this since I NSLog the scheduledNotifications array at application launch, which even after deleting the app and reinstalling it (with the entities of the data model gone), still