• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Advertisement
2
3Advertisement is the ad content requested by [advertising](js-apis-advertising.md#advertisement).
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## Modules to Import
9
10```ts
11import { advertising } from '@kit.AdsKit';
12```
13
14## Attributes
15
16**Atomic service API**: This API can be used in atomic services since API version 12.
17
18**System capability**: SystemCapability.Advertising.Ads
19
20| Name                | Type                       | Read-Only| Optional| Description                                                                                                                                                                                                                                                                          |
21|--------------------|---------------------------|----|----|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
22| 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.<br>If this parameter is left empty, the native ad is used by default.                                                                                                                                                            |
23| uniqueId           | string                    | No | No | Unique ID of the ad.                                                                                                                                                                                                                                                                     |
24| 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.                                                                                                                                                                                                                              |
25| shown              | boolean                   | No | No | Whether the ad is shown.<br>- **true**: The ad is shown.<br>- **false**: The ad is not shown.                                                                                                                                                                                                                                     |
26| clicked            | boolean                   | No | No | Whether the ad is clicked.<br>- **true**: The ad is clicked.<br>- **false**: The ad is not clicked.                                                                                                                                                                                                                                  |
27| rewardVerifyConfig | Map&lt;string, string&gt; | No | No | Server verification parameter.<br>{<br>customData: "test",<br>userId: "12345"<br>}                                                                                                                                                                                                             |
28| [key: string]      | Object                    | No | Yes | Custom parameter.<br>- **isFullScreen**: The value is of the Boolean type. It specifies whether a splash ad is in full-screen mode. The value **true** means that the ad is in full-screen mode, and **false** means that the ad is in half-screen mode.<br>- **biddingInfo**: An object containing ad information. It is used to obtain real-time bidding results. **biddingInfo.price**: the Effective Cost Per Mille (eCPM) of an ad. **biddingInfo.cur**: the currency of an ad. **biddingInfo.nurl**: URL used to specify the successful bidding results returned by the media. **biddingInfo.lurl**: URL used to notify other Demand-Side Platforms (DSPs) of the bidding success result when the bidding fails.|
29