The minimum requirements for this guide is that you already have a project on the google developer console.
1. Integrate the Push Notifications SDK
Install the Push Notifications SDK
The Push Notifications SDK might not be visible by default inside the Package Manager in your Unity Editor version.
You can install the Push Notifications SDK inside your Unity Project in one of three ways:
The firebase SDK is not required to be added.
1. Import using the Unity Registry
- Open your Project Settings from Edit -> Project Settings.
- Open the package manager from -> Package Manager.
- Under the Packages dropdown, select Unity Registry.
- Search for Push Notifications in the search bar in the top right to view the Push Notifications package.
- Select Install in the top right.
Register for Push Notifications
To receive Push Notifications, your app needs to register for Push Notifications. Follow Registering for Push Notifications for details.
2. Upload your service keys
To send notifications from the Unity Gaming Services dashboard, you need to upload service keys from Firebase for Android and from your Apple Developer account for iOS.
You need a Firebase Service Account Key to be added to your Unity project settings before sending notifications to Android devices. This needs to be done for every UGS environment of the game that you expect to test or use notifications with.
- Go to your Firebase Console and select your project.
- Go to Project Settings and select Service accounts at the top.
- Select Create service account.
- Select Generate new private key and download it.
- In the Unity Cloud Dashboard, select Products > Push Notifications > Settings then go to Google Keys and select the Add Key or Edit Icon in the "Google Key" row.
- In the Editor navigate to Project Settings > Services > Push Notifications and configure your Android (Firebase) Settings.
You can find the values in the following
Firebase Web API Key: The "Web API Key" This can be found in project Settings->General->Your Apps -> google-services.json. Open this file and copy the API Key into your editor settings.
Firebase Project Number: Can be found at Settings->General->Your Project->Project Number
Firebase App ID: Can be found at Settings->General->Your apps->App ID
Firebase Project ID: Can be found at Settings->General->Your Project->Project ID
Then return to the Dashboard and click the Next button to move to the next step in the Google Key configuration wizard.
- Upload the private key created in the previous steps and select Finish.
For security reasons this file won’t be visible if you re-enter the edit settings page.