Overview
This article is based on Huawei’s In-App Purchases. I will develop a new demo game using Huawei IAP. I will provide the ads remove feature. So user can upgrade the game also can purchase other exciting feature in the game with an online payment using In-App Purchases.
Service Introduction
In-App Purchase allows the user to purchase an app-based item such as Game coins, app-based subscriptions. The developer advertises upgrades to the paid version, paid feature unlocks, special items for sale, or even ads other apps and services to anyone who downloads the free version. This allows the developer to profit despite giving the basic app itself away for free.
Huawei IAP provides a product management system (PMS) for managing the prices and languages of in-app products (including games) in multiple locations.
Following are 3 types of in-app products supported by the IAP:
1. Consumable: Consumables are used once, are depleted, and can be purchased again.
2. Non-consumable: Non-consumables are purchased once and do not expire.
3. Auto-renewable subscriptions: Users can purchase access to value-added functions or content in a specified period of time. The subscriptions are automatically renewed on a recurring basis until users decide to cancel.
Prerequisite
1. Unity Engine (Installed in the system)
2. Huawei phone
3. Visual Studio 2019
4. Android SDK and NDK (Build and Run)
5. Must have Huawei Developer Account
6. Must have Huawei Merchant Account
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.
3. Navigate to In-App Purchases and Copy Public Key.
4. Navigate to My Apps, click Operate, and then enter details in Add Product.
5. Click View and edit in the above image, enter Product price details, and then click Save.
6. Click Activate for product activation.
Game Development
1. Create a 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 AppId and other details from agconnect-service.json file and click configure Manifest.
7. Create Huawei IAP based scripts.
I have created IapTestManager.cs file in which integrated Huawei in-app Purchase which redirects to the merchant account.
Click on IapTestManager.cs and open in Visual Studio 2019.
More details, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0204430572402270046
Related
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.
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
Introduction
App Linking or deep linking is a technology which enable businesses to provide ease of access for their potential services.
Deep links are links which re-direct users directly to a specific app or application feature instead of a website or store.
They are used to re-direct users straight to in-app locations, saving the users time and energy.
Deep linking does this by specifying a custom URL scheme (iOS Universal Links) or an intent URL (on Android devices) that opens your app if it’s already installed. Deep links can also be set to direct users to specific events or pages.
Huawei App Linking leverage developers/users to create cross platform links which can work as defined and can be distributed via multiple channels to users.
When the user taps the link, it will be re-directed to the specified in-app content.
{
"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"
}
Huawei App Linking has multiple functions:
1. Support for deferred deep links
2. Link display in card form
3. Data statistics
Huawei App Linking supports the link creation in multiple ways:
1. Creating a link in AppGallery Connect
2. Creating a link by calling APIs on the client
3. Manually constructing a link
Use Case
There could be multiple use cases for this capability, however I will throw some light on a use case which is most commonly adapted by the applications with complex UX and high transmission between different in-app pages.
In this scenario one application shares the link between counter applications to re-direct to in-app content of a third application.
We will have an application which shares the app link at one end to another (It can be a simple chat platform capability). At the receiver end, user can click on the link and directly navigate to the specific in-app content.
Working
Following are the steps to develop this scenario
1. Development of news application which will be deployed locally.
2. Development of share application which will be deployed locally.
3. Integration of Huawei App Linking Api’s to receive the link and re-direct to the in-app content of news app.
4. Enabling the App linking service in AppGallery Connect.
5. Creating deep link through AppGallery Connect.
Development Overview
1. Must have a Huawei Developer Account
2. Must have Android Studio 3.0 or later
3. Must have a Huawei phone with HMS Core 4.0.2.300 or later
4. EMUI 3.0 or later
Software Requirements
1. Java SDK 1.7 or later
2. Android 5.0 or later
Preparation
1. Create an app or project in Android Studio.
2. Create an app and project in the Huawei AppGallery Connect.
3. Provide the SHA Key and App Package name of the project for which you want the App Linking to be done (Example: News application)
4. Download the agconnect-services.json file and paste to the app folder of your android studio.
Integration
Add below to build.gradle (project)file, under buildscript/repositories and allprojects/repositories.
Code:
Maven {url 'http://developer.huawei.com/repo/'}
Add below to build.gradle (app) file, under dependencies to use the App Linking SDK.
Code:
dependencies{
// Import the SDK.
implementation 'com.huawei.agconnect:agconnect-applinking:1.4.1.300'
}
News Application
News application is developed with multiple content and complex UX to show the capability of the Huawei App Linking.
I will highlight some of the important code blocks for this application.
Main Activity
This activity is the entry point for the application which will have the navigation tab to handle the multiple news categories.
Also, it receives the App Link, read it and re-direct it to the corresponding content.
Creating a link in AppGallery Connect to directly open the Science tab for the News Application through a link
1. Login to AppGallery Connect.
2. Choose My Projects > NewsWorld(App Linking).
3. Choose > Growing > App Linking>Enable now
More details, you can visit https://forums.developer.huawei.com/forumPortal/en/topic/0204412564790410224
For details, please refer to. :HUAWEI Ads Media Access Guide.
{
"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"
}
1. Registering a Developer Account and Performing Identity Verification
For details, please refer to Account Registration and Authentication.
2. Enabling the Merchant Service
For details, please refer to Merchant Service.
3.Signing the HUAWEI Ads Publisher Service Agreement
a. On the HUAWEI Ads Publisher page, click Start now. Read the HUAWEI Ads Publisher Service Agreement that is then displayed. If you agree, select By checking this box I confirm that I have read and agree to be bound by HUAWEI Ads Publisher Service Agreement. The agreement takes effect immediately.
b. You can also click the Monetize service card on the console to quickly access the HUAWEI Ads Publisher Console.
4. Applying for Media
a. On the HUAWEI Ads Publisher Console, go to App management > Add app, select the app to place ads, set mandatory parameters, and submit it for review.
b. An app can be added only after it is released in HUAWEI AppGallery. You can only apply for media for an app released in HUAWEI AppGallery.
c. Huawei will review the application in one to two working days (there may be a delay during weekends and holidays).
d. You can set Advertiser industry restrictions and App promotion restrictions for the app.
5. Creating an Ad Unit
a. You can create an ad unit only after the application is approved. Go to Ad unit management > Add ad unit.
b. Select the target app, set the ad format, style, and size of the ad unit, specify Ad unit name, and submit the settings for them to take effect.
c. Set Ad unit name to the app name + scenario + style format (for example, Huawei Video in-feed large image).
d. To fulfill operations requirements, you can:
1)Set the ad format, style, and size for an ad unit by selecting a value. You cannot customize these attributes.
2)Change the name of an ad unit.
3)Add the ad styles and sizes of an ad unit.
4)Delete the ad styles and sizes of an ad unit. However, at least one style and one size must be retained.
5)Enable or disable an ad unit.
An ad unit and its associated app cannot be deleted.
6. Integrating the HUAWEI Ads SDK
Integrate the HUAWEI Ads SDK into your app based on the HUAWEI Ads SDK Development Guide.
7. Testing Ad Delivery
a. Test ad delivery before commercial release, including the loading and display of ads.
Attention: Confirm the requirements on the user privacy statement. Release the privacy statement in the name of your app, and the statement should contain the requirements for using third-party advertising services. It is prohibited to release the privacy statement in the name of Huawei or HUAWEI Ads.
b. Send the APK package that has passed the self-test as well as the app and ad unit information to Huawei customer service personnel for acceptance.
8. Releasing Your App
After your app is accepted, Huawei will inform you that you can release it. It will be then possible to release your app with the HUAWEI Ads SDK integrated with HUAWEI AppGallery.
You can view reports on the HUAWEI Ads Publisher Console to obtain commercial ad delivery data.
For details about Huawei developers and HMS, visit the website.
HUAWEI Developer Forum | HUAWEI Developer
forums.developer.huawei.com
Interesting.
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?