Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8541125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:45:33+00:00 2026-06-11T11:45:33+00:00

We’ve encountered a very odd problem with regards to local notifications firing while our

  • 0

We’ve encountered a very odd problem with regards to local notifications firing while our app is not running. By not running, I mean it is completely terminated (does not appear in the task list when you double-tab the home button).

Under normal running conditions, while the app is backgrounded, if the device is motionless for more than X number of seconds, the app will generate a local notification with warning a sound. 15 seconds after that, if no action has been taken, another local notification is generated with an emergency message.

Seemingly at random, hours or days after the app was terminated, the device will suddenly report a warning notification, followed by the emergency notification approximately 15 seconds later, just as though the app was running normally in the background. As stated, we have verified that the app is not listed in the running tasks lists, and appears to be completely terminated.

The app is registered for long-term background processing modes for location, audio, and VOIP.

When the app terminates (in applicationWillTerminate), we perform cleanup, which includes shutting down and nullifying timers, cancelling local notifications, etc.

I have two theories:

  1. I wonder if these “ghost” notifications are merely old
    notifications that were queued up while the app was running, but
    were never executed until now (my question is then why is the time
    difference between the warning and emergency notification still
    respected).
  2. Is it possible that the app is “secretly” running somewhere in the deep background. If so, it appears as though the device periodically “wakes” the app up; if this is the case, what is the device using as criteria for this “wakeup call”.

I wonder if anybody has encountered this odd issue, and if so, how we resolve the issue?

P.S – We are quite new to iOS development, so apologies in advance if we’ve overlooked something completely obvious

Update #1
Using log messages through xCode, I have observed applicationWillTerminate being consistently called when the application is shut down via task bar closure. There does seem to be a lot of debate about whether this behaviour can be relied upon, though, so I won’t say conclusively whether I believe my observation to be consistent, but I am leaning in that direction. Any further insight on this, however, would be appreciated!

Update #2
I tried a new approach last night; until now we were scheduling a notification to fire “now” by using the [application scheduleLocalNotifications] method, and setting the the date to the current time. Instead, I used the [application presentLocalNotificationNow] method, and supplied no date/time. The app still functions properly, however it did not resolve the problem, as the ‘ghost’ notifications triggered randomly last night while the app was not running. I am wondering now if the issue is less of an ‘old notification’-related problem, and more to do with the application being “woken up” due to some trigger as a result of our long-term background execution registration.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:45:34+00:00Added an answer on June 11, 2026 at 11:45 am

    Once your app has scheduled a UILocalNotification, they are handled by the operating system, not your app. So even if your app killed, they still go off.

    So no, your app isn’t still secretly running in the deep background, those are just notifications that you already scheduled that are going off. Are you possibly setting a repeatInterval on the notifications?

    You can clear all the notifications by using:

     [[UIApplication sharedApplication] cancelAllLocalNotifications];
    

    It’s possible that your applicationWillTerminate is not getting called before your app gets killed as onnoweb stated. I’m not sure if that always gets called when the user closes the app in the task bar or not.


    Edited to respond to comment:

    My first thought is that you seem to be scheduling UILocalNotifications with incorrect fire dates. I suggest that you check the way that you’re scheduling them. The only way that they could be going off a day after your app has been killed is if you scheduled them while your app was still running.


    Edited to respond to further comment:

    Teeg – I think that it’s possible that applicationWillTerminate sometimes gets called when you kill the app, but is not guaranteed to be called. From what I’ve read, if your app is in a suspended state, the method does not get called. I don’t know exactly how apps with long running background tasks work, but perhaps it switches between background and suspended states. I’m not sure. But the thing is, calling

    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    

    will cancel all your notifications. So if one goes off after that, that is evidence that the method wasn’t called. I guess another possibility could be that the method was called, but the app didn’t have enough time to cancel all the notifications before it was killed. I’m not too sure about how much time you get to do stuff there. I would suggest again though that your best bet is to find out why those notifications are being scheduled in the first place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.