uilocalnotification

Set default iOS local notification style for application

♀尐吖头ヾ 提交于 2019-11-26 08:16:51
问题 Starting with iOS 5, there are two notification styles: banner and alert (the \"old\" style). A user can set which style to use for each application in the settings. However, the default now seems to be that notifications are displayed banner style. I\'m using local notifications for reminders about events that will happen \"now\". A banner disappears shortly after it appeared (and it\'s not obvious enough that one can tap it), so for these notifications it would be desirable to have the

iPhone: Incrementing the application badge through a local notification

随声附和 提交于 2019-11-26 06:28:21
问题 is it possible to increment the application badge through a local notification while the app is not running? I know how to set the badge, but haven\'t found any way to increment this value. localNotification.applicationIconBadgeNumber = 23; Update: I found a (far from being perfect) solution. You can predict what will happen, if the user doesn\'t open the app and add notifications for every +1 event. An example: For day 1: Count = 0 For day 2: localNotification.applicationIconBadgeNumber = 1;

Getting local notifications to show while app is in foreground Swift 3

允我心安 提交于 2019-11-26 05:58:07
问题 Apparently this is now possible with ios10 : optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) This answer basically says the tools needed to do it: Displaying a stock iOS notification banner when your app is open and in the foreground? I\'m just not really understanding how to put it all together. I dont know how important this is, but I\'m

How to set Local Notification repeat interval to custom time interval?

廉价感情. 提交于 2019-11-26 05:53:51
问题 I am making an iPhone app, which has a requirement of Local Notifications. In local notifications there is repeatInterval property where we can put the unit repeat intervals for mintute, hour, day,week,year, etc. I want that repeat interval should be 4 hours. So every 4 hours the local notification comes. I dont want the user to set seperate notifications for each. I want the user to be able to set repeatInterval as 4 hours. How do I do that? 回答1: Got the answer, it is as straight as it gets.

UILocalNotification Repeat Interval for Custom Alarm (sun, mon, tue, wed, thu, fri, sat)

北城以北 提交于 2019-11-26 04:44:00
问题 I\'m using UILocalNotification for Alarm Purpose. I have a custom option for repeat based on weekdays (sun, mon, tue, wed, thu, fri, sat). So many applications did this process. I tried My level best. But I can\'t get it to work. Please you guys help me.... 回答1: You cannot set custom repeat intervals with UILocalNotification. This has been asked before (see below) but only limited options are provided. The repeatInterval parameter is an enum type and it limited to specific values. You cannot

How can I create local notifications in iOS?

主宰稳场 提交于 2019-11-26 01:49:24
问题 I would like to know how I can setup local notifications so that at the time I set, my app generates a notification/alert with a customized message... 回答1: Here is sample code for LocalNotification that worked for my project. Objective-C: This code block in AppDelegate file : - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [launchOptions valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]; // Override point for

Delete a particular local notification

試著忘記壹切 提交于 2019-11-26 00:40:59
问题 I am developing an iPhone alarm app based on local notifications. On deleting an alarm, the related local notification should get cancelled. But how can I determine exactly which object from the array of local notifications is to be cancelled? I am aware of [[UIApplication sharedApplication] cancelLocalNotification:notification] method but how can I get this \'notification\' to cancel it? 回答1: You can save a unique value for key in your local notification's userinfo. Get all local