Before we can start adding notifications to our project, we will need to add a special preview package that Unity makes available. Follow the steps given here:
- From the Unity Editor, go to Window | Package Manager.
- From there, click on the In Project drop-down menu from the toolbar of the Packages menu and select Unity Registry.
- Scroll down the available options until you reach Mobile Notifications and select it. Once there, click on the arrow to the side of it and select See All Versions and then select the latest version (in my case, it was Version 1.3.0). From there, click the Install button and you'll see the following screenshot:
It's important to note that this package requires your game to use Android 4.4 (API 19) and iOS 10 or above in order to function properly.
We will also be using a cross-platform wrapper also written by Unity in order to get notifications working quickly and remove the requirement of writing platform-specific code.
- ...