Hi Rob,
You (or Corrine) have correctly identified the pitfalls regarding
background and foreground. There is one other case and thats when the app
is not actually started up. We still want to send them notifications (at
least for a while) alerting them to traffic issues. After a day or so,
we’ll throttle back these notifications but at least for a few hours or a
day, we need to send them out. We can’t use the content-available flag as
the app isn’t running (in either bg or fg) to handle the flag. So we have
to try to work out if the app is ‘alive’ or not, if the app is not alive we
send down full-fat notifications, this means no content-available flag and
full information to be displayed in the notification drawer.
I think that when your app is not started the OS should start your app when
the notification arrives, so that it can handle it. It could be that the
app is not started because the device is low on power or there are some
heuristics as to how often the app is used, that might come in play as
well. But generally speaking a background notification should start the app
as well.