message  Send Feedback

RequestOptions

The RequestOptions interface. Used when passing additional request options before an advert is loaded.

Properties


Properties

contentUrl

contentUrl?: undefined | string;

Sets a content URL for targeting purposes.

Max length of 512.


keywords

keywords?: string[];

An array of keywords to be sent when loading the ad.

Setting keywords helps deliver more specific ads to a user based on the keywords.

Example

await Interstitial.request('ca-app-pub-3940256099942544/1033173712', {
keywords: ['fashion', 'clothing'],
});

location

location?: string[];

The latitude and longitude location of the user.

Ensure your app requests location permissions from the user.

Example

await Interstitial.request('ca-app-pub-3940256099942544/1033173712', {
location: [53.481073, -2.237074],
});

locationAccuracy

locationAccuracy?: undefined | number;
iOS Only API

Sets the location accuracy if the location is set, in meters.

This option is only applied to iOS devices. On Android, this option has no effect.


networkExtras

networkExtras?: undefined | { [key: string]: string };

Attaches additional properties to an ad request for direct campaign delivery.

Takes an array of string key/value pairs.

Example

Attaches ?campaign=abc&user=123 to the ad request:

await Interstitial.request('ca-app-pub-3940256099942544/1033173712', {
networkExtras: {
campaign: 'abc',
user: '123',
},
});

requestAgent

requestAgent?: undefined | string;

Sets the request agent string to identify the ad request's origin. Third party libraries that reference the Mobile Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a third party ad network called "CoolAds network" mediates requests to the Mobile Ads SDK, it should call this method with "CoolAds".

Example

await Interstitial.request('ca-app-pub-3940256099942544/1033173712', {
requestAgent: 'CoolAds',
});

requestNonPersonalizedAdsOnly

requestNonPersonalizedAdsOnly?: undefined | false | true;

If true only non-personalized ads will be loaded.

Google serves personalized ads by default. This option must be true if users who are within the EEA have only given consent to non-personalized ads.


testDevices

testDevices?: string[];

An array of test device IDs to whitelist.

If using an emulator, set the device ID to EMULATOR.

await Interstitial.request('ca-app-pub-3940256099942544/1033173712', {
testDevices: ['EMULATOR'],
});