In your application, you can access key / value pairs sent from Advanced options > Custom data in the Firebase notification web console in the following ways:
getIntent().getExtras() in an action that fires when the user getIntent().getExtras() notification.
I recommend adding this to the onResume() method.remoteMessage.getData() in FirebaseMessagingService.onMessageReceived() if the application is already open when a message arrives. (in this case, the notification is not displayed, and onMessageReceived() is called onMessageReceived() .
source share