Is it possible to prohibit opening an activity with the notification by the FCM server?
I'm talking about the notification sent via the manifest
If the user clicks the notification, by default it open MainActivity.
I just want it to disappear and not open any activity
I try this but not work :
// [START handle_data_extras]
if (getIntent().getExtras() != null) {
for (String key : getIntent().getExtras().keySet()) {
Object value = getIntent().getExtras().get(key);
Log.d("TAG", "Key: " + key + " Value: " + value);
if (value.equals(myValue)) {
Toast.makeText(this, "Close", Toast.LENGTH_SHORT).show();
finish();
}
}
Temporary solution :
open an activity that closes all :
if (getIntent().getExtras() != null) {
for (String key : getIntent().getExtras().keySet()) {
Object value = getIntent().getExtras().get(key);
Log.d("TAG", "Key: " + key + " Value: " + value);
if (value.equals(myvaluefirebase)) {
Log.d("TAG", "Key value it's OK");
Intent mainIntent = new Intent(SplashActivity.this, **Close.class)**;
startActivity(mainIntent);
SplashActivity.this.finish();
finish();
}
}}