• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Advertisement
2
3This module provides the capability of returning ads.
4
5> **NOTE**
6> - 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.
7
8## How to Use
9
10When using the [advertising](js-apis-advertising.md) function, you can obtain the returned ad through [Advertisement](js-apis-advertising.md#advertisement).
11
12## Advertisement
13
14**Atomic service API**: This API can be used in atomic services since API version 12.
15
16**System capability**: SystemCapability.Advertising.Ads
17
18| Name              | Type                     | Read-Only| Optional| Description                                                                                                                   |
19|--------------------|---------------------------|-----|-----|-----------------------------------------------------------------------------------------------------------------------|
20| adType             | number                    | No  | No  | Ad type.<br>- **1**: splash ad.<br>- **3**: native ad.<br>- **7**: rewarded ad.<br>- **8**: banner ad.<br>- **12**: interstitial ad.<br>- **60**: roll ad.|
21| uniqueId           | string                    | No  | No  | Unique ID of the ad.                                                                                                          |
22| rewarded           | boolean                   | No  | No  | Whether users get rewarded for watching or clicking the ad.<br>- **true**: Users get rewarded.<br>- **false**: Users do not get rewarded.                                                       |
23| shown              | boolean                   | No  | No  | Whether the ad is shown.<br>- **true**: The ad is shown.<br>- **false**: The ad is not shown.                                                                     |
24| clicked            | boolean                   | No  | No  | Whether the ad is clicked.<br>- **true**: The ad is clicked.<br>- **false**: The ad is not clicked.                                                               |
25| rewardVerifyConfig | Map&lt;string, string&gt; | No  | No  | Server verification parameter.                                                                                                        |
26| [key: string]      | Object                    | No  | Yes  | Custom parameter.                                                                                                            |
27