Wakeup app when in background

Hello,

I am trying to move my app to foreground when it is in background mode. for example in whatsapp when you receive a call from someone the app automatically opens. Anyone has an idea of how this can be done?