Integrating New Capabilities of Game Service SDK 5.0.4.302 Using Unity - Huawei Developers

Background​Recently, I found that Unity had released a demo for Game Service SDK 5.0.4.302. Let’s try this version.
Demo download from GitHub
SDK changes
I discovered that the last version of the Unity plugin for the Game Service SDK was 4.0.1.300, whereas the latest version is 5.0.4.302.
This version contains the following changes:
Added GetGamePlayer and GetGamePlayer(bool isRequirePlayerId) to obtain a player’s unique ID.
Added SetGameTrialProcess to listen to trial duration ending, which is used for preventing game addiction.
Added AccountAuthParamsHelper to obtain further information about a HUAWEI ID, including OpenID, UnionID, and the email address.
Added the OpenId, UnionId, AccessToken, and OpenIdSign parameters to the Player object.
Added AppPlayerInfo to save the information of the current player.
You can view change history details about the Game Service SDK on the official website.
Testing the APIs​In this post, I just ran the Unity demo. If you’re not sure how to package and run a demo, check this post.
AccountAuthParamsHelper​According to the C# source code, Unity supports request authorization in the following way:
AccountAuthParamsHelper authParamsHelper = new AccountAuthParamsHelper(); authParamsHelper.SetAuthorizationCode().SetAccessToken().SetIdToken().SetUid().SetId().SetEmail().CreateParams();
By using this code, you can request information including the authorization code, access token, ID token, UID, ID, and email address.
This part is also included in this document. You can complete configurations as required.
I tapped Login then login in the test app, which displayed the following page.
{
"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"
}
I selected Obtain your email address and tapped Authorise and log in. A welcome pop-up was displayed, containing the following information.
The OpenID, UnionID, access token, authorization code, and ID token could be found in the log information.
However, the email address I requested was not obtained. Why did this happen? I contacted Huawei technical support and found that no email address had been configured for the signed-in HUAWEI ID. So, I went to Settings > Account center > Account and security on my Huawei phone and discovered that there was indeed no email address.
After I configured an email address, the address could be obtained. The following figure shows the test result.
Huawei technical support also told me that UIDs currently cannot be obtained.
The latest plugin version allows you to obtain further information about a HUAWEI ID, including a player’s UnionID and OpenID.
GetGamePlayer​This API maps the getGamePlayer API of Game Service SDK 5.0.4.302. According to official documentation, only displayName, openId, unionId, accessToken in the Player object have values. This is how I tested it.
I tapped Player then getGamePlayer in the test app, which displayed the following page.
The result was identical to that described in Huawei’s official documentation.
GetGamePlayer(bool isRequirePlayerId)​This API maps the getGamePlayer(boolean isRequirePlayerId) API of Game Service SDK 5.0.4.302 and allows you to obtain the player ID and OpenID at the same time.
I tapped Player then getGamePlayer(isRequirePlayerId) in the test app, which displayed the following page.
This was also consistent with Huawei’s description.
Usage Description of GetGamePlayer and GetGamePlayer(bool isRequirePlayerId)​For details about how to use the two APIs, please check this document.
setGameTrialProcess​Official documentation states that this API is required for games released in the Chinese mainland in order to prevent game addiction. I skipped this step as my app will be released outside the Chinese mainland. In order to test this API you must submit a request to Huawei.
AppPlayerInfo​This class is used when the savePlayerInfo API is called. I did not test this API as we saved our player information independently, meaning we did not use this API.
Test Summary​Compared with Game Service SDK 4.0.1.300, this version of the Unity plugin has the following major changes:
Allowed you to set what information is obtainable from a HUAWEI ID, including OpenID, UnionID, and the email address.
Added the getGamePlayer API to allow games that have replaced player IDs with OpenIDs or UnionIDs to obtain player information. The getCurrentPlayer API is also available if you use the player ID as a unique user identifier.
Allowed games released in the Chinese mainland to call setGameTrialProcess for game trial support.

Can we use game Service for multiplayer game?

Related

[AppsUP] Frequently Asked Questions About Huawei Ads Kit

AppsUP contest has already been launched for one month. A number of participants in the forum ask some questions about Ads Kit. Today I want to share the frequently asked questions of Ads Kit with you. Hope they can be helpful for you.
Q: How to integrate Huawei Ads in my game? How could it compliant to EU consent?
A: Here is the link: https://developers.google.com/admob/android/eu-consent
Q: How to get ads ids for my apps those are available on Huawei Developer Console?
A: regarding getting Ads ID, please first make sure your developer account is a Company Account, because Ads on individual account is not available just yet.
If your account is a company account, you can login to your console
https://developer.huawei.com/consumer/en/console#/serviceCards/
Then look for the Monetize Service section and click on Publisher Service. There you can select My Apps, click Add app, and then you can register your app for Ads Service. Afterwards an Ads ID will be generated for you and will be showed on the panel.
Q: I used cordova for development app and plugins that provided from huawei like analytics and I succeeded, but for ads-kit can’t find guide for integration plugin - only I can find download plugin 4.0.4 and demo example. But what I get Console without any fired event that registered like "failed" and also did not get any Oaid.
A: Some kits are incompatible with non-huawei devices, even if you install the HMS core APK. You can check the compatibility for each kit here.
Q: I find all the sample use the test ads id but how to make the release one?
A: Individual account is not supported yet, but this function will be available at end of August, confirmed by related department.
Q: Why do native ad videos fail to be played and remain in loading state?
A: On mobile phones whose targetSdkVersion is 28 or later, ad video assets may fail to be downloaded. In this case, you need to configure the app to allow HTTP network requests. For details, please refer to Configuring Network Permissions.
Q: What are the differences between the ads-lite SDK, ads-identifier SDK, and ads-install referrer SDK provided by HUAWEI Ads Kit?
A: The Difference:
1. ads-lite: Integrates ad formats such as banner, native, rewarded, interstitial and splash ads.
2. ads-identifier: Obtains the OAID and the value of Disable Ads Personalization.
3. ads-installreferrer: used to obtain an install referrer.
To know more please refer to Integrating the HUAWEI Ads SDK.
Q: How is an ad report generated? Is developer data reported in two copies (one copy for Huawei and the other copy for the third-party platform)?
A: An ad report is generated after the server cleans various ad SDK-reported ad events for the anti-cheating purpose. The ad SDK in the app reports data to the ad platform and third-party advertising platform.
Q: I am individual developer. What platform I can use to monetize my apps?
A: You can apply for the Merchant Service if you want to use the In-App Purchases service, distribute paid apps or themes, or carry out joint operations (for apps, games, and themes) with Huawei. Please follow the instructions here:
https://developer.huawei.com/consumer/en/doc/start/10112#h1-1588057611069
Q: I want to distribute my Games in China. When I select china it asks me to upload some Copyrighted approved content? How can I bring these documents to china government because I am not from China but I want to distribute my games in China as well on App Gallery.
A: a. Publish a game in China, the law has requirements for both companies and games.
For companies: should have ICP, Network culture business license and Internet publishing license
For games: should have Software copyright, Game operation record and ISBN
b. Oversea game companies cannot apply for the certificates, so only have two ways to launch game in China:
Register company in China with 100% domestic capital Agent cooperation, and find a Chinese publisher release in China
Q: Why do banner ads fail to be obtained after my app has integrated the HUAWEI Ads SDK? The displayed error code is 1.
A: If the value of errorCode is 1, check whether AdId and BannerAdSize are correctly set in BannerView. The following table describes the error codes.
{
"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"
}
If you also have other questions about this kit. Leave your reply below.

Distributing your game on Huawei App Gallery with Unity Distribution Portal (UDP)

More information like this, you can visit HUAWEI Developer Forum​
Introduction.
In this article I would like to delve into a topic that has been somewhat recurrent in the questions in the communities, which is the UDP distribution to Huawei App Gallery. So through this this text we will understand how to distribute our game in Unity UDP.
Let's start with a little theory. d( ̄◇ ̄)b
What is UDP?
This service allows us to distribute our game to multiple Android stores through the same concentrator (hub) Using the same build.
Which stores are supported in UDP?
Samsung Galaxy Store
One Store
Mi GetApps
Huawei App Gallery
QooApp Game Store
Share it Game Store
Tpay Mobile Stores
AppTutti
VivePort
{
"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"
}
Which versions of Unity are supported?
Supports from 5.6.1 and later, but it is recommended to use 2018.4+
What is the price of UDP?
It is free for developers and you can download it from the package manager in your project.
Procedure on UDP Platform
Let's see how we install it.
Once we have the distribution Portal installed, we should have the following menu in the Window tab.
Now we have to create an ID in case we don't have one already created.
Once the Unity ID has been created it will be necessary to go to the Unity Distribution portal page, in this portal we can create our game for distribution.
https://distribute.dashboard.unity.com
Inside the portal we have to create a new game on the console
Now we must capture the data of our game
After we complete the filling of data, we have to create a Release Version of our Game. We can create a revision TAG and some notes
Now its time to select the store where we want to release our game so
We are going to select Huawei App Gallery so I want to share with you the process to of releasing on this store.
Procedure on App Gallery Console
Sign up to HUAWEI AppGallery
The First requisite is to have a Huawei developer verified account. Im quite sure that you have one because you are surfing through this Forum. So lets skip this step.
Sign in into AGC to create yout Game App
Create your game on AppGallery
Fill the forms on the registration of App. Dont forget to select Game
Important!! o(・_・)9
Be sure to match your game genre to the one you choose on UDP
Like most of the Kits of HMS we have to set the package name manually so take the name that you assign on your Unity Project
link your game to UDP
Now Go! back to UDP Distribution Portal and Click Link game to UDP and authorize the link by authenticating with your HUAWEI account.
Your game should now be linked between AppGallery and UDP. If an error pops up, be sure to correct it with the error details provided.
Complete your game registration
Once your game is linked to UDP successfully, you will reach the Game Registration form. The greyed-out fields were retrieved from AppGallery during the linking process. The remaining fields need to be input manually before you can complete the registration of your game.
Where can i find the following information?
This information can be found in your AGC Console
Final Step Submitting your game to HUAWEI AppGallery
Go the the Publish section
Any warnings or errors will be flagged ahead of submitting your game to AppGallery. Errors must be addressed before you can submit.
You can set a launch date for your game, but only before submitting it.
When you’re satisfied, click “Publish” at the top right of the screen.
You will be sent to the Status section showing your game’s submission progress.
Once your submission is successful, you still have one last step to perform on the AppGallery console.
Conclusion
I hope this small guide helps you to understand and complete your UDP Publication

【Integration Guide】HUAWEI Account Kit Overview

About HUAWEI Account Kit​
HUAWEI ID is the credential that provides users with access to a wide range of Huawei services, such as Huawei cloud services. As a fundamental development service offered by HMS Core, Account Kit provides you with simple, secure and quick sign-in and authorization functions. Rather than needing to repeatedly enter account and password information, and then wait for authentication, users can simply tap the Sign in with HUAWEI ID button to sign in directly to your app via their HUAWEI IDs.
Advantages​
Authorized Sign-in for All Scenarios​
Account Kit enables the user to be authorized to sign in to your app through a HUAWEI ID, sparing them from having to enter personal information, setting passwords, and waiting to have the information verified by email or SMS message. Once authorization has been completed, no sign-in authorization screen will be displayed when the user signs in to your app again, greatly reducing the user churn rate during registration and sign-in.
In addition, Account Kit supports seamless sign-in switching between different devices, including mobile phones, tablets, Vision, head units, and watches. This helps you better present your product and services on Huawei devices across all scenarios.
{
"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"
}
A Global HUAWEI ID User Base​
Account Kit enjoys a truly global reach, serving more than 190 countries and regions, and coming supported in 70+ languages. By integrating the service into your app, you'll benefit from access to a vast number of new potential users, and be equipped to expand your presence in new markets.
Secure and Reliable Services​
Account Kit complies with prestigious international protocols, including OAuth 2.0 and OpenID Connect, and enables users to complete sign-in via a password and verification code, with the data encrypted, as well as offers an RISC-based cross-account protection function. This rigorous framework helps ensure that Account Kit meets relevant user privacy regulations around the world, and when coupled with HUAWEI ID sign-in, frees you from the hassle of managing user account data.
HUAWEI ID has obtained the EuroPriSe certification.
A Convenient and Cohesive Solution​
1. The development guide, sample code, and integration tool for Account Kit are continually being optimized to reduce integration costs.
ü Quick integration on the client: You can use HMS Toolkit to download the demo, check development environment configuration, and drag and drop the required code to complete integration in half a working day.
ü Quick integration on the server: You can reference both the Java and PHP sample code.
2. Account Kit allows you to connect to the Huawei ecosystem using your HUAWEI ID from a range of different devices, including mobile phones, tablets, and Vision.
Account Kit offers simple, secure and quick sign-in and authorization functions. In addition, it leverages the reach of its vast user base and all-scenario ecosystem, to provide you with direct access to new users in new markets.
We will continue to optimize Account Kit to help you achieve your business goals, and hope you'll enjoy access to such a broad range of game-changing services.
Use a browser to scan the QR code below to try the demo app:
(Note: The app may collect relevant information for user statistics.)
(Note: The app may collect relevant information for user statistics.)
For more information about Account Kit, please visit:
l Development guide
l Codelab
l Video course
For more details, you can go to:
l Our official website
l For GitHub to download demos and sample codes
| Original Source

Expert: How to Integrate Huawei Ads with GameAnalytics in Unity (Part-2)

Introduction
In this article, we will learn GameAnalytics integration in Unity Game.In previous article, we learnt about some of the features provided by the GameAnalytics.In this part-2 we will implement the Huawei Ads kit, will know practivcally how GameAnalytics helps Huawei Ads events like Ad opened, Ad shown, Ad clicked and Ad failed to show, which can be easily recorded by GameAnalytics and also we will look into SourceEvents and Remote configuration, and other useful features of GameAalytics which makes easy to get custom reports on the various filters you desired.
Development Overview
You need to install Unity software and I assume that you have prior knowledge about the Unity and C#
Hardware Requirements
A computer (desktop or laptop) running Windows 10.
Android phone with API Level 21 or latest and USB cable, which is used for debugging.
Software Requirements
Java JDK 1.7 or more installation package.
Unity software version: 2020.1.15f1.4895 or latest installed.
Integration Preparations
Create Unity project.
{
"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. Download GameAnalytics plugin.
3. Download HMS plugin.
4. Create project in AG-Console
5. How to integrate Huawei Ads in Unity
6. Choose Assets > Import package > Custom package select GameAnalytics package file and
click OK.
How do I trigger Ads Events?
Ads Events supports only IOS and Android. The GameAnalytics ad event needs to invoke when certain events happen for implemented ad sdk.
An ad sdk has callback methods activating code when certain things like ad show and ad click activated. GameAnalytics makes easy to capture these call-back events to be recorded one has to call GameAnalytics sdk when these delegates called.
The examples below describes how to implement this for the ad-types.
Rewarded video
Interstitial
Bannner
[ICODE]
GameAnalytics.NewAdEvent([URL='https://gaadaction.show/']GAAdAction.Show[/URL], GAAdType.Interstitial,"onAdShow", ad.getAdId());
GameAnalytics.NewAdEvent(GAAdAction.Clicked, GAAdType.Interstitial,"unityad", ad.getAdId());
GameAnalytics.NewAdEvent(GAAdAction.FailedShow, GAAdType.Interstitial, "unity ads failed to load ", ad.getAdId());
[/ICODE]
How do I trigger Impression Events?
Impression events are used to get impression data from different ad networks. Currently the following ad networks are supported:
MoPub
Fyber
IronSource
MoPub
To record impression data from MoPub, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeMoPubImpressions();
}
Fyber
To record impression data from Fyber, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeFyberImpressions();
}
IronSource
To record impression data from IronSource, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeIronSourceImpressions();
}
How do I fetch Remote Configuration value?
GameAnalytics provides remote configuration which allows user to configure key pair values from the remote place and also it allows user to Schedule that is set start date ad end date of the configuration.
String remoteValue = GameAnalytics.GetRemoteConfigsValueAsString("Test");
How can I download reports?
GameAnalytics allows you to various filter option and which makes user to predict and take decision based on the analysis report, you can download various kind of reports as show in the below image.
Result
Tricks and Tips
Make sure you have downloaded latest plugin.
Make sure that GameAnalytics Object is created.
Make sure that required permissions are added in Manifest.
Conclusion
In this article, we have learnt how to integrate Huawei Ads Kit with GameAnalytics in Unity. Which proves you with the ability to create own custom events depending on what you would prefer to capture, remote configuration, Funnel and provides various filter option on report.
Thank you so much for reading, I hope this article helps you to understand the GameAnalytics features in Unity.
Reference
GameAnalytics
GameAnalytics Unity
GameAnalytics Plugin
Check out in forum
is it different from HSM analytics kit?

Web Page Conversion Tracking in HUAWEI Ads and DTM (Part 1)

More and more advertisers are using HUAWEI Ads to promote their apps or web pages in order to attract more users and increase revenue. This article introduces how to track clicks and conversion rates of ads delivered using HUAWEI Ads. HUAWEI Ads works with Dynamic Tag Manager (DTM) to help you easily track conversions on web pages, as well as ad performance.
First of all, what is ad conversion tracking?
Let's use Huawei Vmall as an example. Ads for Vmall are served by HUAWEI Ads. After a user clicks such an ad to access Vmall, user actions, such as adding products to the shopping cart and purchasing products, on one or more in-app pages in a given period (30 days in general) will be tracked.
Now, let's take a look at ad conversion.
When a user clicks an ad to access Vmall and purchases a product in Vmall, this is considered as an ad conversion because a user has been converted into a paying user.
Next, let's see how to configure conversion tracking for web pages in DTM.
You can configure conversion tracking for landing pages, across web pages, or across domains and select an appropriate tracking mode for each scenario in DTM. The configuration involves the following steps:
1. Configuration preparations
2. Conversion tracking for landing pages
3. Cross-page conversion tracking for a single domain
4. Cross-domain conversion tracking
First, you need to perform the following operations before configuring conversion tracking:
1. Register a HUAWEI ID.
2. Register a HUAWEI Ads account.
3. Embed the JavaScript code obtained from DTM into the web page to be tracked.
Procedure:
Step 1 Access AppGallery Connect and register a HUAWEI ID.
Step 2 Access HUAWEI Ads and register an account.
You can use your HUAWEI ID to register a HUAWEI Ads account.
Step 3 Embed the JavaScript code obtained from DTM into the web page to be tracked.
1. Add a web app.
Sign in to AppGallery Connect, select My projects, click Add project, enter a project name, and click OK.
{
"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"
}
Click Add app. On the page displayed, select Web for Platform, set App name, and click OK.
2. Create a configuration in DTM.
In AppGallery Connect, go to Grow > Dynamic Tag Management.
Click Enable Dynamic Tag Manager. In the dialog box displayed, set Configuration name and URL, and click OK. Embed the generated JavaScript code snippet into all web pages to be promoted. The code needs to be embedded only once and will be valid indefinitely.
Step 4 Use Google Tag Manager (GTM) to embed the DTM-Web tracking code snippet.
During version development, it is unpractical to modify the code snippet and release it to the live network immediately. So, how can the code snippet be embedded into web pages without version release?
As many web pages integrate GTM, you can use it to embed the DTM code. The detailed configuration process is as follows:
1. Sign in to GTM and select the container corresponding to the web page to track.
2. Create a tag.
Go to Tags > New. On the page displayed, set Tag Type to Custom HTML and copy the DTM code snippet to the HTML area. Set Firing Triggers to Page View, enter a tag name, and click Save.
3. Create and release a version.
Click Submit. On the page displayed, select Publish and Create Version, enter a version name, and click Publish.
You have now completed the necessary preparations for configuring conversion tracking for web pages.
To learn more, please visit:
HUAWEI Developers official website
Development Guide
Reddit to join developer discussions
GitHub or Gitee to download the demo and sample code
Stack Overflow to solve integration problems
Original Source

Categories

Resources