openharmony 鸿蒙 js-apis-inner-advertising-advertisement

2025-06-12 浏览 (1)

Advertisement

This module provides the capability of returning ads.

NOTE

  • The initial APIs of this module are supported since API version 11. Newly added APIs will be marked with a superscript to indicate their earliest API version.

How to Use

When using the advertising function, you can obtain the returned ad through Advertisement.

Advertisement

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Advertising.Ads

NameTypeRead-OnlyOptionalDescription
adTypenumberNoNoAd type.
- 1: splash ad.
- 3: native ad.
- 7: rewarded ad.
- 8: banner ad.
- 12: interstitial ad.
- 60: roll ad.
uniqueIdstringNoNoUnique ID of the ad.
rewardedbooleanNoNoWhether users get rewarded for watching or clicking the ad.
- true: Users get rewarded.
- false: Users do not get rewarded.
shownbooleanNoNoWhether the ad is shown.
- true: The ad is shown.
- false: The ad is not shown.
clickedbooleanNoNoWhether the ad is clicked.
- true: The ad is clicked.
- false: The ad is not clicked.
rewardVerifyConfigMap<string, string>NoNoServer verification parameter.
[key: string]ObjectNoYesCustom parameter.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ads Kit

harmony 鸿蒙Ads Service Framework Error Codes

harmony 鸿蒙OAID Error Codes

harmony 鸿蒙@ohos.advertising.AdComponent (Non-Full-Screen Ad Component)

harmony 鸿蒙@ohos.advertising.AdsServiceExtensionAbility (ExtensionAbility for Ads) (System API)

harmony 鸿蒙@ohos.advertising.AdsServiceExtensionAbility (ExtensionAbility for Ads)

harmony 鸿蒙@ohos.advertising (Ads Service Framework)

harmony 鸿蒙@ohos.advertising.AutoAdComponent (Carousel Ad Component)

harmony 鸿蒙@ohos.identifier.oaid (OAID) (System API)

harmony 鸿蒙@ohos.identifier.oaid (OAID)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/eQcLat