[admob] Provide a default request for Interstitials & Rewarded Videos
This commit is contained in:
parent
f92e1b7afd
commit
ac2091d890
|
@ -87,7 +87,6 @@ class AdMobComponent extends React.Component {
|
||||||
* @returns {XML}
|
* @returns {XML}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
console.log(this.props)
|
|
||||||
return (
|
return (
|
||||||
<this.nativeView
|
<this.nativeView
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { NativeModules } from 'react-native';
|
import { NativeModules } from 'react-native';
|
||||||
import { statics } from './';
|
import { statics } from './';
|
||||||
|
import AdRequest from './AdRequest';
|
||||||
import { nativeToJSError } from '../../utils';
|
import { nativeToJSError } from '../../utils';
|
||||||
|
|
||||||
const FirebaseAdMob = NativeModules.RNFirebaseAdmob;
|
const FirebaseAdMob = NativeModules.RNFirebaseAdmob;
|
||||||
|
@ -43,8 +44,14 @@ export default class RewardedVideo {
|
||||||
* @param request
|
* @param request
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
loadAd(request: AdRequest) {
|
loadAd(request?: AdRequest) {
|
||||||
return FirebaseAdMob.rewardedVideoLoadAd(this.adUnit, request);
|
let adRequest = request;
|
||||||
|
|
||||||
|
if (!adRequest || !Object.keys(adRequest)) {
|
||||||
|
adRequest = new AdRequest().addTestDevice().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
return FirebaseAdMob.rewardedVideoLoadAd(this.adUnit, adRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue