uilocalnotification

Handling Push Notifications when App is NOT running (i.e Totally Killed)

若如初见. 提交于 2019-12-19 04:14:31
问题 I'm able to send push notifications to my IOS device. But when I click on that notification it just opens the app. No message is shown inside the app. Code used by me: if (application.applicationState == UIApplicationStateActive) { NSString *cancelTitle = @"Close"; NSString *showTitle = @"Show"; NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Some title" message:message delegate:self cancelButtonTitle

Notification service extension for Local notification

大憨熊 提交于 2019-12-19 02:37:12
问题 will system loads Notification service extension and calls its didReceive(_:withContentHandler:) for local notifications in iOS 10? If yes how we can do that? 回答1: No. The accepted answer describes Notification Content Extensions, which allow you to present a ViewController in the expanded notification view, and works with both remote and local notification. Notification Service Extensions, that let you change the content of the notification (attaching images, etc) do not work with local

How to change notification type from Banner to Alert in iOS8?

扶醉桌前 提交于 2019-12-18 09:26:43
问题 I'm trying to create an app that delivers local notifications as an Alert, not a Banner. But looks like banner is the default and I can't find a way to change it on my code. I can change it on the app notification settings and it works perfectly, but I want that configuration to be default. This is the code I use to ask the user for permission to send notifications: UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |

UILocalNotification - repeatInterval reset (no repeat)

别来无恙 提交于 2019-12-18 09:15:16
问题 Overview I am creating a notification based on an existing instance of UILocalNotification Existing instance has repeatInterval set to NSWeekdayCalendarUnit What I want to do I want to set repeatInterval to no repeat, Question What is the constant that I should set repeatInterval to in order for it not to repeat ? 回答1: Taken from Apple documentation: If you assign an calendar unit such as weekly (NSWeekCalendarUnit) or yearly (NSYearCalendarUnit), the system reschedules the notification for

The UILocalNotification sound does not stop playing

不羁的心 提交于 2019-12-18 08:58:19
问题 I have set a custom .aif 30 second file as the local notification sound name. And below is my code for scheduling the local notification. //Function to schedule local notification -(void)schedulelocalnotification:(NSDate *)particularfiredate ringtone: (NSString *)particularringtone name:(NSString *)alarmname info:(NSDictionary *)dicttext { UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate = particularfiredate; notification.soundName =

The UILocalNotification sound does not stop playing

十年热恋 提交于 2019-12-18 08:58:02
问题 I have set a custom .aif 30 second file as the local notification sound name. And below is my code for scheduling the local notification. //Function to schedule local notification -(void)schedulelocalnotification:(NSDate *)particularfiredate ringtone: (NSString *)particularringtone name:(NSString *)alarmname info:(NSDictionary *)dicttext { UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate = particularfiredate; notification.soundName =

Dismiss an already delivered UILocalNotification?

霸气de小男生 提交于 2019-12-18 07:43:35
问题 Is it possible to do this? UIApplication's scheduledLocalNotifications doesn't seem to return notifications that have already been delivered to the user's notification center, so I think this may be by design, but I can't find any documented evidence of this. Anyone know? Thanks! EDIT: Found this: You can cancel a specific scheduled notification by calling cancelLocalNotification: on the application object, and you can cancel all scheduled notifications by calling cancelAllLocalNotifications.

application:didReceiveLocalNotification never called on ios 8

五迷三道 提交于 2019-12-18 04:17:16
问题 Is there any known problem issue with: application:didReceiveLocalNotification delegate on iOS 8? My application creates local notifications using UILocalNotification . When application is in background I get notifications, and when I click on the notification banner, it moves to my app. But this method: -(void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification is never called on iOS 8(Xcode 5.1.1), but works well on iOS 7 or earlier. P.S

Repeat interval for UNNotification

主宰稳场 提交于 2019-12-17 22:01:22
问题 There is an option to set the repeat interval for UILocalNotification. Since Apple has deprecated UILocalNotification and recommend to use UNNotification instead, I couldn't find a way to set a notification with custom repeat interval with UNNotification. var comp = DateComponents() comp.year = 2019 comp.month = 1 comp.day = 9 comp.hour = 14 comp.minute = 14 comp.second = 0 let calendar = Calendar.current let notification: UILocalNotification = UILocalNotification() notification.category =

non-main bundle file as alert sound

送分小仙女□ 提交于 2019-12-17 20:39:17
问题 I'm hoping I'm wrong but I don't think it's possible. In the Local and Push Notification Programming Guide, under "Preparing Custom Alert Sounds" it says that "The sound files must be in the main bundle of the client application". If you can't write to the main bundle, then how can you get a user generated recording (using, say, AVAudioRecorder) to play as the alert sound? On the one hand it seems impossible, but on the other I think there are apps out there that do it (and I'll look for