[Huawei Developers] John Wo:
Introduction

In this article, we will learn how to add Push kit into our Unity Game. Push notifications are those notifications that we receive on our cell phone, smartwatch or computer with a message informing us about an event or encouraging us to take a certain action. While we usually take more time to read an email, we do the opposite with notifications: we respond to the stimulus by seeing them quickly (and it is that many times, to see a push it is not even necessary to unlock our screen). Thus, it is possible to take advantage of push notifications as a direct communication channel with our users, and they are a fundamental tool when it comes to generating engagement and building a lasting relationship.

Implementation Steps

1. Creation of our App in App Gallery Connect

2. Evil Mind plugin Integration

3. Configuration in Unity

4. Creation of the scene

5. Coding

6. Configuration for project execution

7. Final result

App Gallery Connect Configuration

Creating a new App in the App Gallery connect console is a fairly simple procedure but requires paying attention to certain important aspects.

Once inside the console we must create a project and to this project we must add an App.

When creating our App we will find the following form. It is important to take into account that the category of the App must be Game.

Once the App is created, it will be necessary for us to activate the Account Kit in our APIs, we can also activate the Game service if we wish.

HUAWEI Push Kit establishes a messaging channel from the cloud to devices. By integrating Push Kit, you can send messages to your apps on users' devices in real time.

Once this configuration is completed, it will be necessary to add the SHA-256 fingerprint, for this we can use the keytool command, but for this we must first create a keystore and for this we can use Unity.

Remember that we must change the platform we are on since normally Unity will always assign us as a PC platform.

Once the keystore is created we must open the console, go to the path where the keystore is located and execute the following code. Remember that to use this command you must have the Java JDK installed.

Once inside the route

Keytool -list -v -keystore yournamekey.keystore

This will give us all the information in our keystore, we obtain the SHA256 and add it to the App.

Unity Evil Mind Plugin configuration

We have concluded the creation of the App, the project and now we know how we can create a keystore and obtain the sha in Unity.

In case you have not done it now we must create our project in Unity once the project is created we must obtain the project package which we will use to connect our project with the AGC SDK. first of all let's go download the Evil Mind plugin.

GitHub - EvilMindDevs/hms-unity-plugin: The HMS Unity Plugin makes it easy to include Huawei Mobile Services into Unity-based games. Authentication, in-app purchases, push alerts, ads, and interaction with gaming services are just a few of the basic

The HMS Unity Plugin makes it easy to include Huawei Mobile Services into Unity-based games. Authentication, in-app purchases, push alerts, ads, and interaction with gaming services are just a few ...

github.com

In the link you can find the package to import it to Unity, to import it we must follow the following steps.

Download the .unity package and then import it into Unity using the package importer.

Once imported, you will have the Huawei option in the toolbar, we click on the option and add the data from our App.

Once we have imported the plugin we will have to add the necessary data from our App Gallery App and place it within the

required fields of the Unity plugin. Well, now we have our App Gallery App connected to the Unity project.

Now we can add the Push Notifications prefab to our scene remember that to do this we must create a new scene,

for this example we can use the eschena that the plugin provides.

For more, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0202457956096970035