Advertisement
This module provides the requested ad content.
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.
Modules to Import
import { advertising } from '@kit.AdsKit';
Advertisement
The requested ad content.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Advertising.Ads
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| adType | number | No | No | Ad type. - 1: Splash ad. - 3: Native ad. - 7: Rewarded ad. - 8: Banner ad. - 12: Interstitial ad. - 60: Roll ad. If not filled, the default is native ad type. |
| uniqueId | string | No | No | Unique ID of the ad. |
| rewarded | boolean | No | No | Whether users get rewarded for watching or clicking the ad. - true: Users get rewarded. - false: Users do not get rewarded. |
| shown | boolean | No | No | Whether the ad is shown. - true: The ad is shown. - false: The ad is not shown. |
| clicked | boolean | No | No | Whether the ad is clicked. - true: The ad is clicked. - false: The ad is not clicked. |
| rewardVerifyConfig | Map<string, string> | No | No | Server verification parameters. { customData: "test", userId: "12345" } |
| [key: string] | Object | No | Yes | Custom parameters. |