-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
92 lines (78 loc) · 2.41 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import React from 'react'
import {
StyleSheet,
Text,
View,
TouchableOpacity
} from 'react-native'
import Appodeal from 'react-native-appodeal'
const Button = ({ action, children }) => (
<TouchableOpacity onPress={action}>
<Text style={styles.button}>{children}</Text>
</TouchableOpacity>
)
export default class App extends React.Component {
componentWillMount () {
Appodeal.setTesting(true)
Appodeal.disableNetwork('inmobi')
Appodeal.init('6ed531b0a72a393f6a68e36c31200eaf1cf45dd1497bedfb')
Appodeal.setAge(18)
// Appodeal.setBirthday('17/06/1990')
Appodeal.setEmail('[email protected]')
Appodeal.setInterests('testing, react-native, android')
Appodeal.setRelation('dating') // dating / engaged / married / searching / single / other
Appodeal.setGender('female') // female / male / other
Appodeal.setAlcohol('positive') // positive / negative / neutral
Appodeal.setSmoking('positive') // positive / negative / neutral
this.hideBanner()
}
showBannerBottom () {
Appodeal.showBannerBottom()
}
showBannerTop () {
Appodeal.showBannerTop()
}
hideBanner () {
Appodeal.hideBanner()
}
showInterstitial () {
Appodeal.isInterstitialLoaded(result => console.log('Interstitial loaded: ', result))
Appodeal.showInterstitial()
}
showSkippableVideo () {
Appodeal.isSkippableVideoLoaded(result => console.log('Skippable video loaded: ', result))
Appodeal.showSkippableVideo()
}
showRewardedVideo () {
Appodeal.isRewardedVideoLoaded(result => console.log('Rewarded video loaded: ', result))
Appodeal.showRewardedVideo()
}
render() {
return (
<View style={styles.container}>
<Button action={this.showBannerTop}>showBannerTop</Button>
<Button action={this.showBannerBottom}>showBannerBottom</Button>
<Button action={this.showInterstitial}>showInterstitial</Button>
<Button action={this.showSkippableVideo}>showSkippableVideo</Button>
<Button action={this.showRewardedVideo}>showRewardedVideo</Button>
<Button action={this.hideBanner}>hideBanner</Button>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center'
},
button: {
padding: 12,
backgroundColor: '#eaeaea',
borderRadius: 24,
minWidth: 200,
marginBottom: 12,
textAlign: 'center'
}
})