Detect BACKGROUND mode when APP receive external notification in iOS
===

This is my first question after using the knowledge here for more than 1 year. 

This is my problem. I'm developing an APP which allow you to record your location in order to save routes. The main goal of the APP is learn to do not touch your phone when you are driving after start a new route. I can detect when the user sleep the phone and when they unlock the phone and return to the APP except in a specific scenario. Let me explain my self with the following steps:

 1. The user open the APP. 
 2. The user start to record a new route
 3. The user sleep the phone
 4. Then a external notification arrives (like a Viber or Whatsapp message).
 5. The user unlock the phone and then iOS switch to the APP which received the notification <--- for a weird reason I'm unable to detect this switch. I don't need to application name or what the user do after this, I only need to know if my APP goes to background mode.

¿Any answer? Thanks!

