react native rewarded variable declaration
Closed this issue · 0 comments
Tarikk01 commented
export default class Example extends Component {
constructor() {
super();
this.state = {
fluidSizeIndex: 0,
};
}
componentDidMount() {
AdMobRewarded.setTestDevices([AdMobRewarded.simulatorId]);
AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/5224354917');
AdMobRewarded.addEventListener('rewarded', reward =>
console.log('AdMobRewarded => rewarded', reward),
);
AdMobRewarded.addEventListener('adLoaded', () =>
console.log('AdMobRewarded => adLoaded'),
);
AdMobRewarded.addEventListener('adFailedToLoad', error =>
console.warn(error),
);
AdMobRewarded.addEventListener('adOpened', () =>
console.log('AdMobRewarded => adOpened'),
);
AdMobRewarded.addEventListener('videoStarted', () =>
console.log('AdMobRewarded => videoStarted'),
);
AdMobRewarded.addEventListener('adClosed', () => {
console.log('AdMobRewarded => adClosed');
AdMobRewarded.requestAd().catch(error => console.warn(error));
});
AdMobRewarded.addEventListener('adLeftApplication', () =>
console.log('AdMobRewarded => adLeftApplication'),
);
AdMobRewarded.requestAd().catch(error => console.warn(error));
AdMobInterstitial.setTestDevices([AdMobInterstitial.simulatorId]);
AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712');
AdMobInterstitial.addEventListener('adLoaded', () =>
console.log('AdMobInterstitial adLoaded'),
);
AdMobInterstitial.addEventListener('adFailedToLoad', error =>
console.warn(error),
);
AdMobInterstitial.addEventListener('adOpened', () =>
console.log('AdMobInterstitial => adOpened'),
);
AdMobInterstitial.addEventListener('adClosed', () => {
console.log('AdMobInterstitial => adClosed');
AdMobInterstitial.requestAd().catch(error => console.warn(error));
});
AdMobInterstitial.addEventListener('adLeftApplication', () =>
console.log('AdMobInterstitial => adLeftApplication'),
);
AdMobInterstitial.requestAd().catch(error => console.warn(error));
}
<---------------->
AdMobRewarded.addEventListener('rewarded', reward =>
console.log('AdMobRewarded => rewarded', reward),
);
How do I assign data to a variable?