9 changed files with 62 additions and 68 deletions
@ -0,0 +1,60 @@ |
|||
import React from "react" |
|||
import { View, StyleSheet, StatusBar, Text, Dimensions } from "react-native" |
|||
//import { AdMobBanner, AdMobInterstitial, PublisherBanner, AdMobRewarded } from "expo-ads-admob"
|
|||
|
|||
import { colors, texts, credentials } from "./Variables" |
|||
|
|||
import { BannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-ads'; |
|||
|
|||
const adUnitId = __DEV__ ? TestIds.INTERSTITIAL : 'ca-app-pub-4145771316565790~1876877627'; |
|||
/* |
|||
<BannerAd |
|||
unitId={adUnitId} |
|||
size={BannerAdSize.FULL_BANNER} |
|||
requestOptions={{ |
|||
requestNonPersonalizedAdsOnly: true, |
|||
}} |
|||
/> |
|||
*/ |
|||
const screen = Dimensions.get("window") |
|||
|
|||
const styles = StyleSheet.create({ |
|||
container: { |
|||
backgroundColor: colors.yellow, |
|||
position: "absolute", |
|||
bottom: 0, |
|||
left: 0, |
|||
right: 0, |
|||
flex: 1, |
|||
alignItems: "center", |
|||
justifyContent: "center" |
|||
}, |
|||
title: { |
|||
color: colors.white, |
|||
fontSize: 25, |
|||
textAlign: "center", |
|||
fontWeight: "600", |
|||
paddingVertical: 20 |
|||
}, |
|||
banner: { |
|||
width: "100%", |
|||
height: "100%", |
|||
marginVertical: 20 |
|||
}, |
|||
}) |
|||
|
|||
export const Banner = () => { |
|||
|
|||
return ( |
|||
<View style={styles.container}> |
|||
<Text>BANNER...</Text> |
|||
<BannerAd |
|||
unitId={TestIds.INTERSTITIAL} |
|||
size={BannerAdSize.FULL_BANNER} |
|||
requestOptions={{ |
|||
requestNonPersonalizedAdsOnly: true, |
|||
}} |
|||
/> |
|||
</View> |
|||
) |
|||
} |
@ -1,54 +0,0 @@ |
|||
import React from "react" |
|||
import { View, StyleSheet, StatusBar, Text, Dimensions } from "react-native" |
|||
//import { AdMobBanner, AdMobInterstitial, PublisherBanner, AdMobRewarded } from "expo-ads-admob"
|
|||
|
|||
import { colors, texts, credentials } from "../components/Variables" |
|||
|
|||
const screen = Dimensions.get("window") |
|||
|
|||
const styles = StyleSheet.create({ |
|||
container: { |
|||
backgroundColor: colors.yellow, |
|||
position: "absolute", |
|||
bottom: 0, |
|||
left: 0, |
|||
right: 0, |
|||
flex: 1, |
|||
alignItems: "center", |
|||
justifyContent: "center" |
|||
}, |
|||
title: { |
|||
color: colors.white, |
|||
fontSize: 25, |
|||
textAlign: "center", |
|||
fontWeight: "600", |
|||
paddingVertical: 20 |
|||
}, |
|||
banner: { |
|||
width: "100%", |
|||
height: "100%", |
|||
marginVertical: 20 |
|||
}, |
|||
}) |
|||
|
|||
class Banner extends React.Component { |
|||
|
|||
state = { |
|||
results: false |
|||
} |
|||
|
|||
bannerError = (e) => { |
|||
//console.log("Banner error: ", e)
|
|||
} |
|||
|
|||
render() { |
|||
|
|||
return ( |
|||
<View style={styles.container}> |
|||
<Text>BANNER</Text> |
|||
</View> |
|||
) |
|||
} |
|||
} |
|||
|
|||
export default Banner |
Loading…
Reference in new issue