2

I'm creating an application which should count how long the user stays without using his device. For that, I have a timer which stops when the app become suspended. But, before stop the timer, I need to test two things:

  • Incoming Call: The user can answer or reject the call. If he rejects the call, the timer will keep counting. Otherwise, the timer will stop, and when the app becomes activated again, it will show an alert.

  • The iOS system alerts: Reminders, Calendar events, Low Battery, etc. I need to identify if the app become suspended by one of these kind of alerts.

The app already handles the first case. Everything is working for Incoming Calls.

The problem is that I don't know how to check for the second case. How can I identify if the app became suspended by one iOS system alert? Is there any way of doing this?

Bruno Pinheiro
  • 155
  • 1
  • 8
  • 2
    You want to stop the user having the ability to answer incoming calls? I can tell you now that will get rejected by Apple instantly you can't stop a user from answering a phone call. Actually your whole application sounds like it would get rejected. And based on your title you can't handle the iOS system alerts these are handled by the OS not you in your app, you can handle your own alerts and that is it. – Popeye Jun 13 '14 at 16:49
  • @Popeye - Hey, thanks for you answer, but I don't want to disable anything. I just want to stop the timer inside my app. The user can answer an incoming call, but the timer will stop counting, and the user will not receive the reward. In fact, my app was already accepted by the Apple. What I want to know is if I can get the type of OS alert was sent. – Bruno Pinheiro Jun 16 '14 at 13:23
  • OK your question read as though you wanted to stop the user from answering a phone call. Which is why I believe that you haven't received any attention, what you are after seems simple enough (Not near my Mac to give a tested answer though) so maybe just rephrase your question – Popeye Jun 16 '14 at 13:56
  • @Popeye - Thanks! I'd edited my question! Is it better now? :) – Bruno Pinheiro Jun 17 '14 at 16:04
  • 1
    did you found any solution? – Vatsal Shukla May 25 '18 at 05:31
  • 1
    @Vats no, I didn’t. We tried some workarounds, like count the amount of time the app was in background. – Bruno Pinheiro May 25 '18 at 12:02

0 Answers0