react-native-firebase/lib/modules/admob/AdRequest.js

59 lines
1.1 KiB
JavaScript
Raw Normal View History

export default class AdRequest {
constructor() {
this._props = {
keywords: [],
testDevices: [],
};
}
build() {
return this._props;
}
addTestDevice(deviceId?: string) {
2018-01-25 18:25:39 +00:00
this._props.testDevices.push(deviceId || 'DEVICE_ID_EMULATOR');
return this;
}
addKeyword(keyword: string) {
this._props.keywords.push(keyword);
return this;
}
setBirthday() {
// TODO
}
setContentUrl(url: string) {
this._props.contentUrl = url;
return this;
}
setGender(gender: 'male | female | unknown') {
2017-06-01 10:15:37 +00:00
const genders = ['male', 'female', 'unknown'];
if (genders.includes(gender)) {
this._props.gender = gender;
}
return this;
}
setLocation() {
// TODO
}
setRequestAgent(requestAgent: string) {
this._props.requestAgent = requestAgent;
return this;
}
setIsDesignedForFamilies(isDesignedForFamilies: boolean) {
this._props.isDesignedForFamilies = isDesignedForFamilies;
return this;
}
tagForChildDirectedTreatment(tagForChildDirectedTreatment: boolean) {
this._props.tagForChildDirectedTreatment = tagForChildDirectedTreatment;
return this;
}
}