- Log in to the Google cloud console
- Create or select a project. Copy the project ID and enter it in the config as
firebase_projectId
- Go to
IAM & Admin
and selectroles
in the left menu - Create a new role, and name it
CloudMessaging
in the title and id, set it to General Availibility. - Assign two permissions:
cloudmessaging.messages.create
andfirebasecloudmessaging.messages.create
and clickCreate
- Go to
API's& Services
, and click+ Enable API's and Services
- Search for
firebase cloud messaging api
and enable it - Next, go to
Credentials
and create a new credential. Choose for the service account, enter a name, and ID, and copy the email-address generated - Open the new user and navigate to the
keys
tab. Add a new key, and chose the json format. The downloaded file should be places in the config directory and configured in the config file asfirebase_credentialsFile
- Open a cloud shell (Icon in the top-right corner).
- Assign the role to the user by running :
gcloud projects add-iam-policy-binding <projectID> --member=serviceAccount:<serviceaccount-email> --role=projects/<projectID/roles/CloudMessaging