Huawei GameService supports unity .
You can follow list to integrate game service to Unity .
We use UDP(Unity Distribution Portal) that allows you to distribute your games to multiple app stores through a single hub.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Note : Before you begin operation You must learn UDP and How it works.for this reason you can visit this pageshttps://docs.unity3d.com/Packages/[email protected]/manual/Before_you_begin_know_this.html)
(https://docs.unity3d.com/Packages/c...al/Configuring_Unity_Distribution_Portal.html)
Integrate UDP SDK : To use UDP in-app purchases, implement the integration on the client and the server sides. If your game is offline, you only need to implement the client-side integration. If your game is online, you can opt to also implement the server-side integration...
(for details : https://docs.unity3d.com/Packages/c...manual/Implementing_UDP_in-app_purchases.html )
Download & integrate UDP specified Huawei AppGallery Game Services : Game Service helps you build basic game functions such as achievements, leaderboards, and saved games at low costs.
(Details : https://assetstore.unity.com/packages/add-ons/services/huawei-appgallery-game-services-164354 )
to learn information about Huawei GameService visit this Link
Build game with UDP SDK and Huawei AppGallery Game Services in Unity Editor : Building your game and deploying it to the UDP console.
(Details: https://docs.unity3d.com/Packages/c...game_and_deploying_it_to_the_UDP_console.html)
Upload game to UDP Console and prepare Game : The UDP console is a web-based platform where you can manage your games before submitting them to stores.
(Detail: https://docs.unity3d.com/Packages/c..._publishing_your_game_on_the_UDP_console.html)
Register game to Huawei AppGallery : Now we must register on Huawei AppGallery follow this Page
(Detail : https://distribute.dashboard.unity.com/guideDoc/HUAWEI )
Submit game to Huawei AppGallery :After all steps were done successfully you can submit game using UDP Console.
UDP Console -> [Game Detail] -> Publish page.
Configure Huawei specific steps in Huawei AppGallery : You visit this page and read mandatory section (Detail:https://distribute.dashboard.unity.com/guideDoc/HUAWEI)
More information about this, please visit HUAWEI Developers.
Any questions about this process, you can try to acquire answers from HUAWEI Developer Forum.
Related
You can release a Cocos-based game in HUAWEI AppGallery Connect.
1. Building Your Version
Sign in to Cocos Creator, choose Project > Build & Release, and perform configurations as follows:
Select HUAWEI AppGallery Connect as the release platform.
For a joint operations app or game, the package name must end with*.huawei.
Use the keystore information configured previously.
In Cocos SDKHub, select the HUAWEI AppGallery Connect config set you need.
You are advised to deselect Debug Mode. All Huawei SDK APIs require app signature verification, if Debug Mode is selected, the compiler does not sign your app package by default.
2. Compiling Your Version
You can either compile your game in Cocos Creator or Android Studio.
2.1 Compiling in Cocos Creator
In Cocos Creator, go to Project > Build…, and click Compile after the build is complete.
After compilation, you can find the file in $ProjectHome\build\jsb-link\publish\android.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.2 Compiling in Android Studio
Open the following directory in Android Studio and compile your game.$ProjectHome \build\jsb-link\frameworks\runtime-src\proj.android-studio
3. Uploading Your Version
You can release your game version either by uploading it in Cocos Creator directly after build and compilation, or by uploading the compiled file in AppGallery Connect.
Method 1: Click Upload next to Compile in Cocos Creator. Select a login type, and enter the app ID of your game, which was generated by AppGallery Connect. You can set other parameters according to the actual situation. Click Confirm, and verify your HUAWEI ID in the displayed dialog box. After verification, your game version will be uploaded to AppGallery Connect. You can later sign in to AppGallery Connect and go to My apps > Distribute > Version information to view it.
Method 2: Sign in to AppGallery Connect, go to My apps > Distribute > Version information, click Software package management, and upload your app package.
For more details, check:
Integrating HUAWEI Game Service Based on Cocos SDKHub - Integrating Cocos SDKHub:https://forums.developer.huawei.com/forumPortal/en/topic/0203404602609800136
AppGallery Connect documentation:https://developer.huawei.com/consumer/en/doc/distribution/app/agc-release_app
Background
A developer team wants to integrate HUAWEI Out-of-App Purchases, allowing users to purchase a product on the app details page of a game on HUAWEI AppGallery. To use this mode, they need to deep link a user to the app details page, and pass the ID of the product for purchase..
Official documentation: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/appgallerykit-devguide-game#h1-1589804284330
Let’s see how they achieved this.
Implementation
1. Activity Configuration in the Manifest File
The team added intent-filters for an activity of their game.
<data android:scheme=”agpms” androidath=”/product/pay” android:host=”com.sxx.huawei”/>
The assembled request URL is agpms://com.sxx.huawei/product/pay.
The official documentation describes the requirements on the link.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sample code:
2. Code Implementation of Redirection (Opening a Deep Link from Another App)
HUAWEI AppGallery should be used for the testing. However, the team had not released the game on AppGallery, and they failed to find a test environment on the AppGallery side. So they turned to another app.
Java:
Intent intent = new Intent();
intent.setAction("com.google.open02");
intent.addCategory("android.intent.category.DEFAULT");
intent.setData(Uri.parse("agpms://com.sxx.huawei/product/pay?producid=TestProduct503"));
startActivity(intent);
agpms://com.sxx.huawei/product/pay?producid=TestProduct503
Generally, the parameter following a question mark (?) is in the format of key=value&key1=value1.
Sample code:
As shown in the sample code, the only parameter set is producid.
3. Parameter Parsing After Redirection to the Payment Page
If the details page has not been opened before the redirection, the onCreate method of the app activity needs to be called to obtain the intent object for data parsing.
If the details page has already been opened before the redirection, the onNewIntent method of the app activity needs to be called to obtain the intent object for data parsing.
Sample code:
After the team obtains the product ID from the parsed data, the HMS Core SDK displays the payment page.
FAQs
What should I do if I fail to open the payment page after configuring the deep link?
Generally, this problem is caused by the inconsistency between scheme, host, and path in the assembled URL and those in the configuration. You can perform a check by referring to the official documentation.
Overview
In this article, I will create a demo game and integrate Huawei Ads Kit. So the developer can easily monetise their efforts using Reward Ads and Interstitial Ads. I will cover every aspect of the game development with Huawei Ads Kit.
Service Introduction
Ads kit is powered by Huawei which allows the developer to monetization services such as Reward Ads and Interstitial ads. HUAWEI Ads Publisher Service is a monetization service that leverages Huawei's extensive data capabilities to display targeted, high-quality ad content in your game to the vast user base of Huawei devices.
Prerequisite
1. Unity Engine (Installed in the 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.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Navigate to Project settings and download the configuration file.
Game Development
1. Create a new game in Unity.
2. Click 3D, enter Project Name, and then click to CREATE.
3. Now add game components and let us start game development.
4. Download HMS Unity Plugin from below site.
https://github.com/EvilMindDevs/hms-unity-plugin/releases
5. Open Unity Engine and import the downloaded HMS Plugin.
Choose Assets > Import Package> Custom Package
6. Choose Huawei > App Gallery.
7. Provide the AppId and other details from agconnect-service.json file and click configure Manifest.
8. Create Huawei Ads based scripts.
I have created AdsDemoManager.cs file in which integrated Huawei Ads which display Reward Ad and Interstitial Ad functionality.
Click on AdsDemoManager.cs and open in Visual Studio 2019
For codes and detailed information, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0203424621102710033
It can be Useful.
Rebis said:
It can be Useful.
Click to expand...
Click to collapse
It will quite great
How can we configure rewards on server ?
These posts have shown the first few steps of developing a Unity-based game:
Unity Editor Installation and APK Packaging: https://forums.developer.huawei.com/forumPortal/en/topic/0204435788744370088?fid=0101187876626530001
How Can I Use the HUAWEI Game Service Demo Provided by Unity:
So far, you are able to run a game demo provided by Unity.
This post can help you further test the demo to see whether it can:
Complete some of the initialization operations.
Support HUAWEI ID sign-in and obtain player information.
After the demo test, you can write your own code by referring to the demo.
APIs provided by Unity:
APIs for game initialization:
Huawei GameService.AppInit()
HuaweiGameService.Init()
APIs for game sign-in:
HuaweiGameService.Login(ILoginListener listener)
HuaweiGameService.SilentSignIn(ILoginListener listener)
HuaweiGameService.SignOut(ILoginListener listener)
HuaweiGameService.CancelAuthorization(ICancelAuthListener listener)
APIs for obtaining player information:
HuaweiGameService.GetCurrentPlayer(bool isRealTime, IGetPlayerListener listener)
For details about these APIs, see the official documentation of Unity:
https://docs.unity.cn/cn/Packages-cn/[email protected]/manual/appgallery.html#7-api-references-list
Sign-in Process
According to Huawei’s restrictions on joint operations games (https://developer.huawei.com/consum...ry-connect-Guides/appgallerykit-devguide-game), if your game will be:
Released in the Chinese mainland, call the following APIs:
AppInit > Init > login > getCurrentPlayer
Released outside the Chinese mainland only, the following APIs are optional:
AppInit > Init > login > getCurrentPlayer
HUAWEI ID sign-in is also optional.
In this example, I was going to release an app in the Chinese mainland, so I called the related APIs.
Demo Test
Test environment requirements
Device: A Huawei phone running EMUI 10.0.0, with Android 10
HMS Core (APK) version: 5.0.4.301
HUAWEI AppGallery version: 11.0.2.302
Unity version: 2020.1.2f1c1
You can obtain the demo code by referring to the following file. When an API is called, Unity displays a message indicating the calling result, which is very convenient for you to locate faults.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Test steps
1. Start the demo. The following page is displayed.
By default, the HuaweiGameService.AppInit() API is called during app launch. The preceding message indicates that the API is successfully called.
2. Click Init. The following information is displayed.
Note: For a joint operations game, this API needs to be called when the game is launched, as required by Huawei. Unity’s demo provides a button for you to call the API.
3. Click Login, then login. The HUAWEI ID sign-in page is displayed.
Click Authorise and log in. A greeting banner and logs are displayed, indicating that the sign-in is successful.
Note: Ensure that the greeting banner is displayed, or your joint operations game may be rejected during app review.
4. Click getCurrentPlayer. The following information indicates that the player information API is called successfully.
For details about how to verify the player information, please check the official documentation:
https://developer.huawei.com/consumer/en/doc/development/HMS-References/verify-login-signature
The game sign-in is complete when the player information is approved.
Other optional APIs:
HuaweiGameService.SilentSignIn(ILoginListener listener)
Click silentSignIn. The following information indicates that the API is called successfully.
HuaweiGameService.SignOut(ILoginListener listener)
Click signOut. The following information is displayed.
HuaweiGameService.CancelAuthorization(ICancelAuthListener listener)
Click cancelAuthorization. The following information is displayed.
Click login again. The sign-in page is launched again, indicating that the authorization is canceled.
HMS Toolkit is an IDE plugin which provides all the tools you need to develop and release HMS Core-integrated apps in Android Studio. You can use it to create, code, convert, debug, test, and release your apps, and it cuts the cost of development and boosts efficiency by more than three times.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
l Functions
Configuration Wizard enables you to quickly prepare your environment for the integration of HMS Core kits. The configuration process originally comprised 14 steps, during which you had to frequently switch between the IDE and AppGallery Connect. But with this tool, you can automatically configure a full environment, including your team, project module, AppGallery Connect file, and project certificate. It saves a lot of preparation time and improves your efficiency when developing.
l Highlights
Automatic configuration with one click
Streamlines the configuration process.
No need to keep checking documents or switching tools.
Various configuration scenarios
Supports configuring multiple kits at the same time.
Supports all kits for which development preparations are required.
Efficiency boost
Shortens the configuration process from 4 hours to 5 minutes.
Provides you with clear guidance.
l Usage
If you have any questions, please submit a ticket. Huawei technical support will reply to you as soon as possible.
For more information about HMS Toolkit, go to >>
For how to quickly integrate each kit using HMS Toolkit, go to >>
For more operation tutorials, go to >>
For more details, you can go to:
l Our official website
l Our Development Documentation page, to find the documents you need
l Reddit to join our developer discussion
l GitHub to download demos and sample codes
l Stack Overflow to solve any integration problems
Original Source