Expert: Integration of HMS Push Kit and Remote Configuration in Unity Game

Manoj Kumar
3 min readDec 24, 2021

--

Overview

In this article, I will create a demo game and integrate Huawei Push Kit and Remote Configuration. User can send and receive game points to other game users through push notification which is powered by Huawei Push Kit and provide update using Remote Config.

Remote Configuration Introduction

Remote Config is a cloud service that allows you to change the behavior and appearance of your app without any users to download an app update. When you are using Remote Config, create in-app default values that controls the behavior and appearance of your app. Then, use the Huawei App Gallery Connect console to override in-app default values for all app users or for segments of your user base. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.

Push Kit Introduction

Push Kit allows a message that pops up on a mobile device. App publishers can send them at any time. Users do not have to be in the app or using their devices to receive them.

This helps you to maintain closer ties with users and increases user awareness of and engagement with your apps.

Prerequisite74

1. Unity Engine (Installed in system)

2. Huawei phone

3. Visual Studio 2019

4. Android SDK & NDK (Build and Run)

Integration process

1. Sign In and Create or Choose a project on AppGallery Connect portal.

2. Navigate to Project settings and download the configuration file.

3. Enable Push Kit from Manage APIs section.

4. Click Agree the Push service Agreement

5. Select Data storage location

6. Enable Now Push notification.

7. Create Notification

8. Enable Remote Configuration API

9. Use Now Remote Configuration

10. Add New Parameter

11. Save Parameter

12. Release Parameter

Game Development

1. Create new game in Unity.

2. Now add game components and let us start game development.

3. Download HMS Unity Plugin from below site.

https://github.com/EvilMindDevs/hms-unity-plugin/releases

4. Open Unity Engine and import downloaded HMS Plugin.

Choose Assets > Import Package > Custom Package

5. Choose Huawei > App Gallery.

6. Provide the App ID and other details from agconnect-service.json file and click configure Manifest.

7. Create Huawei Push Kit based scripts.

I have created PushManager.cs file in which integrated Huawei push kit based functionality.

Click on PushManager.cs and open in Visual Studio 2019

Result

Let us build the apk and install in android device.

Tips and Tricks

1. HMS plugin v1.2.0 supports 7 kits.

2. Ensure that you have installed HMS Core (APK) 3.0.0.300 or later.

3. Due to Android API restrictions, Huawei phones running earlier EMUI versions and non-Huawei phones, which are sold outside the Chinese mainland can use Push Kit only when Android API level 21 (Android 5.0) or later is used.

4. The Push Kit server allows a maximum of 1,000 tokens for sending messages at a time. If more tokens need to be used, your app server will have to send messages in batches

5. Remote Configuration empowers the team to personalize skins of incoming calls for different audiences on the home page based on the usage data of skins and user behaviour. With the help of Remote Configuration, the skin usage of incoming calls is increased by 19%, and the user activity is increased by 12%.

Conclusion

In this Article, we have learned how to integrate Huawei Push Kit and Remote Config in Unity based Game.

User can send points as rewards to other game’s user via push notification and provide update using Remote Config.

Thanks for reading this article. Be sure to like and comments to this article if you found it helpful. It means a lot to me.

References

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050040060

Original Source

--

--

Manoj Kumar
Manoj Kumar

No responses yet