componentDidMount() { timer.clearTimeout(this); AdMobInterstitial.setAdUnitID(config.adUnitID.iosInterstital); timer.setTimeout(this, 'AdMobInterstitial', () => { AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd((error) => error && console.log(error))); }, 4000); CurrencyStore.listen((state) => this.onCurrencyStoreChange(state)); this.prepareRows(); timer.setInterval(this, 'prepareRows', () => CurrencyActions.updatePrice(), 10000); }
componentDidMount() { AdMobInterstitial.setTestDeviceID('EMULATOR'); AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); AdMobInterstitial.addEventListener('interstitialDidLoad', () => console.log('interstitialDidLoad event')); AdMobInterstitial.addEventListener('interstitialDidClose', this.interstitialDidClose); AdMobInterstitial.addEventListener('interstitialDidFailToLoad', () => console.log('interstitialDidFailToLoad event')); AdMobInterstitial.addEventListener('interstitialDidOpen', () => console.log('interstitialDidOpen event')); AdMobInterstitial.addEventListener('interstitialWillLeaveApplication', () => console.log('interstitalWillLeaveApplication event')); AdMobInterstitial.requestAd((error) => error && console.log(error)); }
'use strict'; var React = require('react-native'); var { AppRegistry, StyleSheet, Text, View, } = React; var Banner = require('react-native-admob').AdMobBanner; var Interstital = require('react-native-admob').AdMobInterstitial; Interstital.setAdUnitId('ca-app-pub-3940256099942544/1033173712'); var Example = React.createClass({ getInitialState: function() { return { size: 'banner', }; }, press(size) { this.setState({ size: size, }); }, showInterstital() { Interstital.tryShowNewInterstitial(null); }, render: function() { return (
showInterstital() { AdMobInterstitial.showAd((error) => error && console.log(error)); }
interstitialDidClose() { console.log('interstitialDidClose event'); AdMobInterstitial.requestAd((error) => error && console.log(error)); }
componentWillUnmount() { AdMobInterstitial.removeAllListeners(); }
import React, {Component} from 'react'; import { View, Text, StyleSheet, Navigator, ToastAndroid, ScrollView } from 'react-native'; import Toolbar from './Toolbar'; import ChapterList from './ChapterList'; import { AdMobBanner, AdMobInterstitial } from 'react-native-admob' AdMobInterstitial.setAdUnitId('ca-app-pub-1547807753053427/3801442596'); class Home extends Component { render() { return ( <View style={styles.container}> <Toolbar icon='menu' title='Home' onPress={this._onIconPress.bind(this)}/> <ScrollView> <Text style={styles.title}>The Criminal Code of the Philippines</Text> <ChapterList {...this.props} /> </ScrollView> <AdMobBanner bannerSize={"banner"} adUnitID={"ca-app-pub-1547807753053427/1406379399"}
AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd((error) => error && console.log(error)));
timer.setTimeout(this, 'AdMobInterstitial', () => { AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd((error) => error && console.log(error))); }, 4000);
import { Actions, Router, Scene } from 'react-native-router-flux'; import { AdMobInterstitial } from 'react-native-admob'; import DeviceInfo from 'react-native-device-info'; import GoogleAnalytics from 'react-native-google-analytics-bridge'; import TabIcon from './app/components/tab-icon'; // Views import MoreView from './app/views/more'; import NewsView from './app/views/news'; import CalculatorView from './app/views/calculator'; import I18n from './app/utils/i18n'; import { config } from './app/config'; AdMobInterstitial.setAdUnitID(config.admob[Platform.OS].interstital); GoogleAnalytics.setTrackerId(config.googleAnalytics[Platform.OS]); if (DeviceInfo.getDeviceName() === 'iPhone Simulator' || DeviceInfo.getManufacturer() === 'Genymotion') { AdMobInterstitial.setTestDeviceID('EMULATOR'); GoogleAnalytics.setDryRun(true); } // @todo remove when RN upstream is fixed console.ignoredYellowBox = [ 'Warning: In next release empty section headers will be rendered.', 'Warning: setState(...): Can only update a mounted or mounting component.', ]; const scenes = Actions.create( <Scene key="root">