I want to receive a message, I send with Firebase Cloud Messaging. If my app is in the foreground I can receive the message and send an own notification (change logo, send extraData, ...). But if my App wasn't in the foreground or closed, Android gets a notification from the Firebase-System. I can't catch them. So I'm not able to put some extraData into the notification. I need extraData, because I want to open my App by onclick on the notification AND load some special data inside the app dependent from the message.
public class MyFirebaseMessagingService extends FirebaseMessagingService {
public MyFirebaseMessagingService() {
super();
}
@Override
public void onMessageReceived(RemoteMessage message) {
// enters only, if app is in the foreground
super.onMessageReceived (message);
final String msg = message.getData().get("body");
sendMyNotification(msg);
Log.d("MyFirebaseIIDService","new Notification");
}