I'm building a reminder-like application that will remind people to take their medication on a scheduled time by firing up a notification to ask the user to open the app for more details about the medication they should take. I'm planning to use local notification instead of push notification, but just wondering if the local notification will still work even if the application is terminated (swipe up in task manager, or in my case I set the app to terminate once home button is clicked).
Asked
Active
Viewed 688 times
-1
-
What do you mean by local notification here? – User511 Nov 17 '16 at 04:13
-
4What happened when you tried it? – matt Nov 17 '16 at 04:16
2 Answers
1
Yes, local Notification will work even if your app is terminated. You just need to register a Local Notification with a date on which you want to fire that Notification.
Local Notification will fire on the registered date whether your app is terminated or not.

Ketan Parmar
- 27,092
- 9
- 50
- 75

Rajat
- 10,977
- 3
- 38
- 55
1
Shortest answer : Yes, here is an example how to use local notifications in your app
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:60];
localNotification.alertBody = @"Your alert message";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification]
the fire date property tills the system when you want to fire the notification even if your app is suspended.
Reference : Appcoda!

Ketan Parmar
- 27,092
- 9
- 50
- 75

Abd Al-rhman Taher Badary
- 725
- 6
- 16
-
1If you are copying code from somewhere then give citation or reference!! [http://www.appcoda.com/ios-programming-local-notification-tutorial/](http://www.appcoda.com/ios-programming-local-notification-tutorial/) – Ketan Parmar Nov 17 '16 at 05:11
-