Added notifications arriving support

Handling the cases were the app is started, it's in the background,
and in the foreground.

Fixes for checking the notification key in app.json.