forked from EvanBacon/pillar-valley
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { AdMobBanner as NAdMobBanner } from "expo-ads-admob"; | ||
import React from "react"; | ||
import { Platform, StyleSheet } from "react-native"; | ||
|
||
// todo: maybe just hardcode the adUnitID | ||
|
||
export const AdMobBanner = React.forwardRef( | ||
( | ||
{ adUnitID, ...props }: React.ComponentProps<typeof NAdMobBanner>, | ||
ref: any | ||
) => ( | ||
<NAdMobBanner | ||
{...props} | ||
adUnitID={ | ||
__DEV__ | ||
? // Test IDs | ||
Platform.select({ | ||
ios: "ca-app-pub-3940256099942544/2934735716", | ||
android: "ca-app-pub-3940256099942544/6300978111", | ||
}) | ||
: // Overridden ID | ||
adUnitID | ||
} | ||
ref={ref} | ||
/> | ||
) | ||
); | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
width: "100%", | ||
height: "100%", | ||
flex: 1, | ||
}, | ||
image: { | ||
...StyleSheet.absoluteFillObject, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
backgroundColor: "#FFC266", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import { Platform } from "react-native"; | ||
|
||
export const adUnitId = Platform.select<string | null>({ | ||
ios: "ca-app-pub-2312569320461549/2517428180", | ||
android: null, // todo: android | ||
default: null, | ||
}); | ||
// Test IDs iOS: https://developers.google.com/admob/ios/test-ads | ||
// Android: https://developers.google.com/admob/android/test-ads | ||
export const rewardAdUnitId = __DEV__ | ||
? Platform.select<string | null>({ | ||
ios: "ca-app-pub-3940256099942544/1712485313", | ||
android: "ca-app-pub-3940256099942544/5224354917", | ||
default: null, | ||
}) | ||
: Platform.select<string | null>({ | ||
ios: "ca-app-pub-2312569320461549/2517428180", | ||
android: "ca-app-pub-2312569320461549/9830096940", // todo: android | ||
default: null, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters