Lines Matching refs:ad

59 Loads an ad.
82 | 21800003 | Failed to load the ad request. |
102 …rameter, which specifies whether the ad can be downloaded while mobile data is in use. The value 1…
104 …// Set the maximum ad content rating. The following values are available: w: ages 3+, all audience…
106 …// Specify whether you want your ad content to be treated as COPPA-compliant. The following values…
108 …// Specify whether you want the ad request to be processed in a way that meets the GDPR for users …
111 // Listener for the ad loading status.
113 // Called when the ad request fails.
116 `request single ad errorCode is: ${errorCode}, errorMsg is: ${errorMsg}`);
118 // Called when the ad request is successful.
120 hilog.info(0x0000, 'testTag', '%{public}s', 'succeed in requesting single ad!');
121 // Save the requested ad content for display.
127 // Load the ad.
128 hilog.info(0x0000, 'testTag', '%{public}s', 'request single ad!');
161 | 21800003 | Failed to load the ad request. |
187 …rameter, which specifies whether the ad can be downloaded while mobile data is in use. The value 1…
189 …// Set the maximum ad content rating. The following values are available: w: ages 3+, all audience…
191 …// Specify whether you want your ad content to be treated as COPPA-compliant. The following values…
193 …// Specify whether you want the ad request to be processed in a way that meets the GDPR for users …
196 // Listener for the ad loading status.
198 // Called when the ad request fails.
203 // Called when the ad request is successful.
206 // Save the requested ad content for display.
213 // Load the ad.
222 showAd(ad: Advertisement, options: AdDisplayOptions, context?: common.UIAbilityContext): void
224 Shows a full-screen ad.
235 | ad | [Advertisement](#advertisement) | Yes| Ad object.|
250 | 21800004 | Failed to display the ad. |
264 // Requested ad content.
265 private ad?: advertising.Advertisement;
268 // Whether to mute the ad. By default, the ad is not muted.
277 // Show the ad.
278 advertising.showAd(this.ad, this.adDisplayOptions, this.context);
280 … hilog.error(0x0000, 'testTag', '%{public}s', `show ad catch error: ${err.code} ${err.message}`);
293 Defines the ad configuration.
302ad content to be treated as COPPA-compliant.<br>- **-1** (default value): uncertain. You do not wa…
303 | adContentClassification | string | No| Maximum ad content rating.<br>- **W**: ages 3+, all audien…
305ad request to be processed in a way that meets the GDPR for users in the EEA under the age of cons…
310 Defines the ad request parameters.
320 …d ad.<br>- **1**: splash ad.<br>- **3**: native ad.<br>- **7**: rewarded ad.<br>- **8**: banner ad
330 Enumerates the callbacks used for the request for loading an ad.
340 Called when an ad request fails.
348 | errorCode | number | Yes| Result code indicating the ad request failure.|
349 | errorMsg | string | Yes| Error message about the ad request failure.|
356 Called when an ad request is successful.
402 | errorCode | number | Yes| Result code indicating the ad request failure.|
403 | errorMsg | string | Yes| Error message about the ad request failure.|
438 Defines the requested ad content.
448 | uniqueId | string | No|Yes| Unique ID of the ad.|
449 | rewarded | boolean | No|Yes| Whether users get rewarded for watching or clicking the ad.<br>- **t…
450 | shown | boolean | No|Yes| Whether the ad is shown.<br>- **true**: The ad is shown.<br>- **false**…
451 … clicked | boolean | No|Yes| Whether the ad is clicked.<br>- **true**: The ad is clicked.<br>- **f…
453 … whether such an ad is in full-screen mode. The value **true** means that the ad is in full-screen…
459 Defines the ad display parameters.
468 …y the media server that a user should be rewarded for interacting with the ad, so as to avoid spoo…
469 …y the media server that a user should be rewarded for interacting with the ad, so as to avoid spoo…
471 …mute | boolean | No| Whether to mute the ad video.<br>- **true**: The ad video is muted.<br>- **fa…
473 … by this parameter. Otherwise, ads are not rotated and only the first ad in the ad response is dis…
479 Defines the ad status change callback.
487 onStatusChanged(status: string, ad: advertising.[Advertisement](#advertisement), data: string)
489 Called when the ad display status changes.
497 | status | string | Yes| **status**: ad display status, which can be<br>**onAdOpen**, **onAdClose**…
498 | ad | advertising.[Advertisement](#advertisement) | Yes| Content of the ad.|
507 onStatusChanged: (status: string, ad: advertising.Advertisement, data: string) => {
516 Obtains the body of an ad request. This API uses a promise to return the result.
530 | Promise&lt;string&gt; | Promise used to return the ad data of the string type.|
562 …// Set the maximum ad content rating. The following values are available: w: ages 3+, all audience…
566 …// Specify whether you want your ad content to be treated as COPPA-compliant. The following values…
568 …// Specify whether you want the ad request to be processed in a way that meets the GDPR for users …
592 Parses the body of an ad response.
613 | 21800005 | Failed to parse the ad response. |
625 // Listen for the ad parsing callback.
627 // Called when ad parsing fails.
632 // Called when ad parsing is successful.
635 // Save the parsed ad content as an array for display.
641 hilog.info(0x0000, 'testTag', '%{public}s', 'parse ad response!');
650 Injects an ad JavaScript object to the **Web** component.
699 `register web ad interface error: ${err.code}, ${err.message}`);