RequestOptions
The RequestOptions is an optional options object to be sent whilst loading an ad, such as keywords & location. Setting additional options helps BlueStack choose better tailored ads from the network. Following are the full range of options available,
Here's an example of how to create options for any ad:
RequestOptions options = RequestOptions();
options.setAge(25);
options.setLanguage('en');
options.setGender(Gender.female);
options.setKeyword('testbrand=myBrand;category=sport');
/// [location] The geographical location of the user.
/// [consentFlag] The consent status for using location data.
options.setLocation(
Location(
latitude: 37.7749,
longitude: -122.4194,
provider: LocationProvider.gps),
1);
options.setContentUrl('https://developers.bluestack.app/');
Enum representing the gender of a user:
enum Gender {
/// Male gender
male,
/// Female gender
female,
/// Gender is unknown or not specified
unknown,
}
Enum representing different location data providers:
enum LocationProvider {
/// No location data available
empty,
/// Location from network-based sources
network,
/// Full location data available
full,
/// Location from GPS
gps,
/// Passive location updates
passive,
}
Note :
The setLocation
method takes the following parameters:
- The Location instance.
- The CONSENT_FLAG value (corresponds to a int : 0,1,2 or 3).
- 0 = Not allow to send location.
- 1 = When you managed location according to consent value.
- 2 and 3 = Allow the SDK to managed location directly in accordance with the consent value use TCF v1 or TCF v2, see with the madvertise team it depends on your implementation.