Petal Ads (Real Ads)
This GitBook documentation explains how to add applications and units to the Petal Ads Publisher Console and then integrate them with a Unity application using the HMS Unity Plugin.
Step 1: Add your apps and units on the Petal Ads Publisher Console
In this step, you will add your apps and units to the Petal Ads Publisher Console. You can choose from different ad formats, such as banner, native, interstitial, rewarded, splash, or roll.
Prerequisites
You have registered a developer account on HUAWEI Developer and completed identity and merchant verification. You have released your apps and signed the service agreement.
You have logged in to the Petal Ads Publisher Console.
Procedure
Click Traffic Management > Apps on the left navigation bar.
Click Add App and enter the app information, such as source, app name, app type, role type, and SHA-256 certificate fingerprint, then click Submit under the page.
After adding the app, click Traffic Management > Add units and select the ad format you want to use, such as banner, native, interstitial, rewarded, or splash.
Enter the unit information, such as unit name, unit size, asset type, screen orientation, and how to describe ad unit position.
After creating the unit, you will get a unit ID that you need to use in the integration.
Tips
You can add multiple apps and units on the console, and manage them according to your needs. You can also edit or delete the apps and units you have created.
You can view the unit details, such as unit ID, unit status, and ad format, by clicking the unit name on the console.
You can find the details in this document.
Step 2: Add the Ad Unit ID in Unity using the HMS Unity Plugin
In this step, you will add the Ad Unit ID in Unity using HMS Unity Plugin. You will need the Ad Unit ID to request and display ads in your game.
Prerequisites
You have completed the previous steps of creating an ad using Huawei Petal Ads Publisher Service.
You have downloaded the HMS Unity Plugin from GitHub.
You have imported the plugin into your Unity project and followed the instructions to configure your manifest and connect your game with the HMS Manager.
Procedure
Open the HMS Ads Kit Settings window from the menu bar: Huawei > Kit Settings > Ads Kit.
Enter your Ad Unit IDs for the ad formats you want to use in your game. You can find them on the Petal Ads Publisher Console.
Save the settings and use the HMS Ads Kit to request and display ads in your game. You can refer to the documentation for more details.
Tips
You can test the ad display in your game using the test mode. You can enable the test mode by setting the TestDeviceId property in the HMS Ads Kit Settings window.
You can customize the ad display options by using the AdParam class in the HMS Ads Kit.
You can implement the ad listeners, such as OnAdLoaded, OnAdFailed, and OnAdClosed, to handle the ad events in your game logic.
Last updated