[Huawei Developers] Basavaraj.navi:
Introduction

In this article, we will learn how to integrate Ads kit in Unity 3D application using Official Plugin (Huawei HMS AGC services). This example covers the Reward Ads.

First we will understand why we need Ads kit.

Every company makes or builds some kind of product. Building or developing is not a big deal but marketing is the big deal to earn money.

Traditional marketing

1. Putting Banners in City.

2. Advertisement in Radio or TV or newspaper.

3. Painting on the wall.

4. Meeting distributors with sample of product.

So, now let’s understand the drawback of each traditional marketing.

1. Putting Banners in City

You know in one city there will be many localities, sub localities streets, area, main roads, service roads etc. How many places you will put banners? If you consider one city only you need to put so many banners and when it comes to multiple cities and globe level. Imagine you need so many marking people across all the cities. And also think about cost. As an organization they need profit with less investment. But when they go with banner advertisement they have to spent lot of money for marketing only.

2. Advertisement in Radio or TV or newspaper

Now let’s take radio or TV advertisement and newspaper. Let’s take example in one home there are 5 people. How many TV’s will be there?

Max 1 or 2.

What about phones?

Its mobile world everyone will have phone. 5 member’s means 5 phones some times more than 5 because few people will have 2-3 phones.

There are thousands of channels. If you want to give advertisement how many channels you will give, 1 or 2 or max 10 channels you will give advertisement. Do you think all people will watch only those channels which you have provided advertisement?

Radio and newspaper also right. Nowadays who will listen radio? Now everyone is moving towards the social media. And also everybody is reading news in mobile application nobody takes newspaper because people started think about paper is waste and people are thinking about environment.

3. Painting on the wall.

How many houses you will paint? Just think about money and time. As I said earlier, think about multiple cities and multiple streets.

4. Meeting distributors with sample of product.

Meeting distributors with sample product. Do you think this will work out? No it won’t work out because all marketing person will not have same marketing knowledge. On top of that you should have to give training about product for them. Even after training about product they will miss some main key points of product while explaining distributors. If distributors are not convinced about product which is explained by marketing person straight away they will say “no to your product”.

Nowadays, traditional marketing has left its place on digital marketing. Advertisers prefer to place their ads via mobile media rather than printed publications or large billboards. In this way, they can reach their target audience more easily and they can measure their efficiency by analysing many parameters such as ad display and the number of clicks. In addition to in-app purchases, the most common method used by mobile developers to generate revenue from their application is to create advertising spaces for advertisers.

In this sense, Huawei Ads meets the needs of both advertisers and mobile developers. So what is this HMS Ads Kit, let’s take a closer look.

Now let us understand Huawei Ads.

Ads Kit leverages the vast user base of Huawei devices and Huawei's extensive data capabilities to provide you with the Publisher Service, helping you to monetize traffic. Meanwhile, it provides the advertising service for advertisers to deliver personalized campaigns or commercial ads to Huawei device users.

The video on this page introduces traffic monetization through Ads Kit, advantages of HUAWEI Ads Publisher Service, and the process for advertisers to display ads.

You can click here to watch the MOOC video about Ads Kit.

Types of Huawei Ads

Banner Ads.

Native Ads.

Rewarded Ads.

Interstitial Ads.

Splash Ads.

Roll Ads.

Banner Ads.

Banner ads are rectangular images that can occupy a spot within an app's layout, either at the top, middle, or bottom of the device screen. Banner ads refresh automatically at regular intervals. When a user clicks a banner ad, the user is redirected to the advertiser's page.

Native Ads.

Native ads can be images, text, or videos, which are less disruptive and fit seamlessly into the surrounding content to match your app design. You can customize native ads as needed.

Rewarded Ads.

Rewarded ads are full-screen video ads that allow users to view in exchange for in-app rewards.

Interstitial Ads.

Interstitial ads are full-screen ads that cover the interface of an app. Such an ad is displayed when a user starts, pauses, or exits an app, without disrupting the user's experience.

Splash Ads.

Splash ads are displayed immediately after an app is launched, even before the home screen of the app is displayed. You need to design a default slogan image for the app in advance, and ensure that the default slogan image is displayed before a splash ad is loaded, enhancing user experience.

Rolls Ads.

Roll ads are displayed as short videos or images, before, during, or after the video content is played.

Requirements

1. Unity Editor.

2. Huawei device or cloud debugging.

3. Visual Studio 2019.

Follow the steps on AppGalley.

Step 1: Create project on AppGallery.

Step 2: Add application to project.

Step 3: Add data storage location.

Step 4: Add SHA-256 fingerprint.

Follows the steps Client Side.

1. Create Unity Project

Step1: Open unity Hub.

Step2: Click NEW, select 3D, Project Name and Location.

Step3: Click CREATE, as follows:

2. Click Asset Store, search Huawei HMS Core App Services and click Import, as follows.

3. Once import is successful, verify directory in Assets > Huawei HMS Core App Services path, as follows.

4. Choose Edit > Project Settings > Player and edit the required options in Publishing Settings

5. Verify the files created in Step 4.

6. Download agconnect-services.json and copy and paste to Assets > Plugins > Android, as follows.

7. Choose Project Settings > Player and update package name as per agconnect-service.json file.

8. Open LauncherTemplate.gradle and add below line.

implementation 'com.android.support:appcompat-v7:28.0.0'Copy codeCopy code

9. Open AndroidManifest file and Add below permissions.

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>Copy codeCopy code

10. Open "baseProjectTemplate.gradle" and add lines, as follows.

maven {url 'https://developer.huawei.com/repo/'}Copy codeCopy code

11. Open "mainTemplate.gradle" and add lines like shown below.

implementation 'com.huawei.hms:ads-lite:13.4.29.303'

implementation 'com.huawei.hms:ads-consent:3.4.30.301'Copy codeCopy code

12. Create Scripts folder and create a class.

HuaweiHMSAds.cs

Result

Tips and Tricks

Add agconnect-services.json file without fail.

Add SHA-256 fingerprint without fail.

Make sure dependencies added in build files.

Conclusion

In this article, we have learnt what is Ads and why do we need Ads and advantages of ads over the traditional marketing. And also we have learnt types of Ads provided by the Huawei. We have built and run unity project which shows the reward Ads image ads and video ads.

References

HMS Ads Kit