uilocalnotification

UILocalNotification repeatInterval on 20 days

故事扮演 提交于 2019-12-11 09:37:21
问题 I'd like to create local notification with custom interval repeat (every 20 days for example). I know we have NSDayCalendarUnit, kCFCalendarUnitMonth ... but I hope to set repeat interval at 20 days. I don't want to create a notification for every day. My real need is to repeat a notification for consecutive 21 days, then don't launch it for 7 days later, then a new 21 days with notification and 7 days without ... etc. I should schedule all these days even if application is inactive. To do

How to set a weekly local notification in swift

久未见 提交于 2019-12-11 07:57:37
问题 I've got a problem with my code. I want to set a local notification in xcode7, I'm developing a calendar where you can put your university's courses, the thing is that I'm getting the schedule from a json database and I want to notify 15 min before the class starts, but I do not know why my code is not working. This is an example where I want to repeat the notification every Monday at 13:40. Can I only set the day and the hour? or should I specify the month and the year too? var dateComp

App from App store doesn't show up for all users under Notification Center (Local Notifications)

陌路散爱 提交于 2019-12-11 07:48:12
问题 Has anyone had any problems with users downloading your app from the app store and the app not showing up in the Notification center (and thus notifications not showing up)? I've tested the app on various devices and haven't been able to recreate the problem that a percentage of my users are having. They email me telling me the app is missing from the Notification center, yet when I download it, it's there. All of my users are using iOS 7 too. For reference, I've implemented local

How to set Local Notification repeat interval on Prayer time different times?

六眼飞鱼酱① 提交于 2019-12-11 07:06:46
问题 In local notifications there is repeatInterval property where we can put the unit repeat intervals for minute, hour, day, week, year, etc. I want that repeat interval on Prayer time hours and every day same process. So every Prayer time hours the local notification comes. Prayer time is everyday different times 回答1: You can't do it with repeat. Make a bunch of different make notifications - one for each day - for the next 30 days. When the user opens the app, then recreate them for the next

Dismiss local notifications when application becomes active

喜你入骨 提交于 2019-12-11 06:25:23
问题 I am developing an IM application that keeps connection open for some time when application is backgrounded and uses local notifications to alert user about new incoming messages. Previously, on iOS 4, -[UIApplication cancelAllLocalNotifications] was called before presenting a new local notification using -[UIApplication presentLocalNotificationNow:] . This way always only the latest notification was present on the screen. Since iOS 5 introduced Notification Center, this solution is not

Delete a UILocalnotification at a certain indexpath

半腔热情 提交于 2019-12-11 06:17:57
问题 I have a bunch of UILocalNotifications but I only want to delete a certain one at a given indexpath, therefor [[UIApplication sharedApplication] cancelAllLocalNotifications]; wont work out for me. I know I can use [[UIApplication sharedApplication] cancelLocalNotification:UILocalNotification]; but how do I get the UILocalNotification from the given NSIndexPath? Thanks. 回答1: You can get an array of scheduled notification from: @property(nonatomic,copy) NSArray *scheduledLocalNotifications Get

How to show the widget same like an Alarm widget (Clock APP)?

巧了我就是萌 提交于 2019-12-11 06:05:44
问题 I need to do the app same as Clock Alarm functionality. Once we set the Alarm for some time like 3.15PM (Even app is not in running state) It shows in Today Notification screen - we can do this(your alarm......) using APP Extension (using User defaults), right? As Pop up screen Alarm Pop Up in lock screen - My Question - a. How can we achieve both 2 and 3, Is this a same APP Extension concept? b. In First - I believe they used User defaults, Can we do the API access in APP Extension like

Swift - Local notification icon badge number update on deliver App is in background

本小妞迷上赌 提交于 2019-12-11 04:54:33
问题 I am trying to figure how I can update dynamically the icon badge number when a local notification is delivered. Registering the badge number upon scheduling is not an option since if I register two or more notification before any are delivered the UIApplication.shared.applicationIconBadgeNumber // this will be zero will always be zero until a notification is delivered. I can use the UNUsernotification delegate with the func func userNotificationCenter(_ center: UNUserNotificationCenter,

UILocalNotification stop sound after notification is dismissed

允我心安 提交于 2019-12-11 04:05:31
问题 I have an app that will set an alarm for the user. The alarm is a basic UILocalNotification with a sound file that is 12 seconds long. The sound plays on the device but it does not go away when the use dismisses the notification. I got it to stop playing sound on the simulator by using this - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. UILocalNotification *localNotif

How does UIApplication cancelAllLocalNotifications work between app updates?

两盒软妹~` 提交于 2019-12-11 02:36:05
问题 Does anyone know how the cancelAllLocalNotifications method works on UIApplication? I'm wondering specifically how iOS knows what to cancel. Does it know by App ID? Or does it use the version number of the app somehow? What I'm experiencing right now is more notifications than I expect. This is the workflow: Cancel all notifications on app start Schedule notifications on app exit *When scheduling, add the notification info to a "Recents" list *When scheduling, schedule only 1 notification per