Local notifications and push notifications are both ways for an iOS application that isn’t running in the foreground to let its users know it has something for them.
Questions tagged [uilocalnotification]
2308 questions
136
votes
11 answers
Displaying a stock iOS notification banner when your app is open and in the foreground?
When Apple's official iOS Messages app is open and in the foreground, new messages from other contacts trigger a stock, native iOS notification alert banner. See image below.
Is this possible in 3rd party apps on the App Store? Local and/or Push…

pkamb
- 33,281
- 23
- 160
- 191
115
votes
5 answers
Ask for User Permission to Receive UILocalNotifications in iOS 8
I have set up local notifications in the App Delegate Using this:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UILocalNotification *notification = [[UILocalNotification alloc]init];
[notification setAlertBody:@"Watch…

dannysandler
- 1,881
- 4
- 16
- 14
94
votes
14 answers
Delete a particular local notification
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…

Yogi
- 3,578
- 3
- 35
- 56
53
votes
11 answers
Using @available with stored properties
I have an app that uses local notifications and supports iOS 10. I am trying to add iOS 9 support which requires me to use the old location notification API. I am trying to use @available and #available on my iOS 10 code and I can't figure out how…

chickenparm
- 1,570
- 1
- 16
- 36
51
votes
5 answers
Getting local notifications to show while app is in foreground Swift 3
Apparently this is now possible with ios10 :
optional func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler:…

user6820041
- 1,213
- 2
- 13
- 29
48
votes
4 answers
UILocalNotification is deprecated in iOS 10
It may be a question in advance but I wonder what to use instead of UILocalNotification in iOS 10. I am working on an app which has deployment target iOS 8 so will it be ok to use UILocalNotification?

Roohul
- 1,009
- 1
- 15
- 26
43
votes
8 answers
Test if app did become active from a UILocalNotification
Is there a way to know if the application did become active from a local notification?
I know there is a way to test if the application was launched from a local notification alert; but if it just was sitting out there the background, and received…

wh1t3cat1k
- 3,146
- 6
- 32
- 38
41
votes
11 answers
detect "Allow Notifications" is on/off for iOS8
I am trying to detect the Local notification settings for the App in iOS 8
for UIUserNotificationSettings, it returns me 7 as I have turned on all Badge, Sound & Alert.
In the setting, I switch off "Allow Notification" , the app still return me 7…

JosephT
- 865
- 1
- 11
- 20
41
votes
8 answers
Find list of Local Notification the app has already set
My app allows users to set a number of reminders in the future. When the app lauches I want to know what reminders (notifications) have already been set.
Can I read back the notifications I have set or do I need to store in my app (e.g. Core Data…

Recycled Steel
- 2,272
- 3
- 30
- 35
39
votes
4 answers
Triggering a specific action when the app enters foreground from a local notification in iOS? (using swift)
I am building an iOS app using the new language Swift. Now it is an HTML5 app, that displays HTML content using the UIWebView. The app has local notifications, and what i want to do is trigger a specific javascript method in the UIWebView when the…

cptdanko
- 812
- 2
- 13
- 22
38
votes
6 answers
Set default iOS local notification style for application
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…

DarkDust
- 90,870
- 19
- 190
- 224
32
votes
5 answers
Launch a local notification at a specific time in iOS
I am trying to create a timer which triggers a local notification to go off at a time that the user has set. The issue I am having is that I cannot figure out a way to be able to set the local notification to go off at say 7:00PM. Almost all the…

imjonu
- 515
- 1
- 6
- 12
31
votes
5 answers
How to delete all local notifications when an application is deleted from an iPhone
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]…

Nimit Parekh
- 16,776
- 8
- 50
- 72
30
votes
3 answers
Determining if UILocalNotification fired with app in foreground or background
When receiving a UILocalNotification
The method application:DidReceiveLocalNotification is called when the app is in Foreground.
When the app is in the Background, it opens the application and then calls application:DidReceiveLocalNotification.…

Mark Andrews
- 311
- 1
- 3
- 5
30
votes
11 answers
iPhone: Incrementing the application badge through a local notification
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:…

Stefan
- 28,843
- 15
- 64
- 76