[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}
|
||||
*/
|
||||
render() {
|
||||
console.log(this.props)
|
||||
return (
|
||||
<this.nativeView
|
||||
{...this.props}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { NativeModules } from 'react-native';
|
||||
import { statics } from './';
|
||||
import AdRequest from './AdRequest';
|
||||
import { nativeToJSError } from '../../utils';
|
||||
|
||||
const FirebaseAdMob = NativeModules.RNFirebaseAdmob;
|
||||
|
@ -43,8 +44,14 @@ export default class RewardedVideo {
|
|||
* @param request
|
||||
* @returns {*}
|
||||
*/
|
||||
loadAd(request: AdRequest) {
|
||||
return FirebaseAdMob.rewardedVideoLoadAd(this.adUnit, request);
|
||||
loadAd(request?: AdRequest) {
|
||||
let adRequest = request;
|
||||
|
||||
if (!adRequest || !Object.keys(adRequest)) {
|
||||
adRequest = new AdRequest().addTestDevice().build();
|
||||
}
|
||||
|
||||
return FirebaseAdMob.rewardedVideoLoadAd(this.adUnit, adRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue