Notify user when app running in the background state change

Notify user when app running in the background state change

Let say the user is using the app and its doing come processing , while waiting the user went to check  text messages. How can one get the app alert the user.