If you want your app to handle push notification even if it is in background, or you simply need „silent push”, you need to use data message.
Basically there are two types of payloads – notification, which will be visible for the user, and data which will be not visible. For data messages you have custom key-value pairs with your needed data.
More info can be found below this great StackOverflow question: https://stackoverflow.com/q/37711082/7586488