I've implemented Firebase in my app and I'm sending push with extra data. When my app is in foreground I'm handling data properly and showing my own notification, but I have a problem with fetching data, when Firebase shows Notification "automatically" when app was "homed" (not killed). According DOCS Activity
should get new Intent
with extras fulfilled with my values, instead app just get back to front, old state is restored.
Scenario:
- opening app, pressing Home
- sending push through Firebase console, Firebase is creating
Notification
WITHOUT callingonMessageReceived
(according to table in docs, it should?) - when user pick notification app will be brought to front in same state as was "homed", and
Intent
is fulfilled with "original" extras used for openActivity
on top
I have logs in onCreate
, onNewIntent
, onResume
(Activity
) and in onMessageReceived
(Service
), only onResume
is called, in which I'm printing extras like below:
if (getIntent().getExtras() != null) {
for (String key : getIntent().getExtras().keySet()) {
Object value = getIntent().getExtras().get(key);
Log.d("Activity onResume", "Key: " + key + " Value: " + value);
}
}