Version: 1.3
语言 : 中文
Push Service
Notification Service

Ads Service

The Ads Service provides the ability to access different types of advertisements for OpenHarmony projects. By integrating Ads Kit, you can integrate Banner Ads, Rewarded Ads, Interstitial Ads and Splash Ads directly into your application.

For more information, you can click the following link to reach directly:

Ads Service config

To integrate with Ads service:

  1. Open the OpenHarmonySDKKitsSettings window.

  2. Fill in the common configuration include client_id, app_id, Bundle Name.

  3. Check the Ads Kit.

  4. Check the certain type of Ads.

  5. Fill in the corresponding advertising ID and related parameters, such as Banner Size and Refresh Time for Banner Ads.
    • If you don’t have an advertising ID, you can use the following test ID:
      • Banner Ads: testw6vs28auh3
      • Rewarded Ads: testx9dtjwj8hp
      • Interstitial Ads: testb4znbuh3n2
      • Splash Ads: testd7c5cewoj6
  6. Click on Open Scene to open the demo scene with the interface integrated, and operate each function in the scene.

    Check the Ads Kit
    Check the Ads Kit

Ads Service demo scene

To open the Ads Service demo scene in the Tuanjie Editor: OpenHarmonySDKKits > OpenHarmonySDKKitsSettings > Ads Kit > Open Scene.

There are 4 integrated ad types built into the scene. Click the corresponding button to load the corresponding ads.

Ads Scene
Ads Scene

The functions of buttons and their calling interfaces are as follows:

Area Description
show Banner Ads Click to load and show the banner ads.
show Rewarded Ads Click to load and show the rewarded ads.
show Interstitial Ads Click to load and show the interstitial ads. The default is non-full screen display, and the size can be adjusted as needed.
show Splash Ads Click to load and show the splash ads. The default is non-full screen display, and the size can be adjusted as needed.
Output Log The relevant log will be displayed here.

Export and build

To run the demo on the OpenHarmony devices:

  1. Open the OpenHarmonySDKKitsSettings window.
  2. Make sure client_id, app_id and Bundle Name have been filled correctly. Make sure Ads Kit have been checked.
  3. Make sure the Ads Id have been filled correctly.
  4. Open the Build Settings window.
  5. Switch to OpenHarmony platform and check Export Project.
  6. Export project.
  7. Open the exported project in DevEco, build and run on OpenHarmony device.
Push Service
Notification Service