Visit the following url and register your app. Download the google-services.json file and note the API Key.
https://developers.google.com/mobile/add?platform=android&cntapi=gcm
Copy the google-services.json file to the project's app directory.
https://www.learn2crack.com/2016/05/integrating-gcm-push-notification-in-android.html