-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
77 lines (69 loc) · 1.86 KB
/
index.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
import React from 'react';
import { AppRegistry } from 'react-native';
import { name as appName } from './app.json';
import {
RootScreen,
RewardedScreen,
InterstitialScreen,
NativeScreen,
StandardScreen,
} from './app/screen';
import { TapsellPlus } from 'react-native-tapsell-plus';
import { APP_KEY } from './app/Constants';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
class TapsellPlusSample extends React.Component {
constructor() {
super();
TapsellPlus.initialize(APP_KEY);
TapsellPlus.setGDPRConsent(true);
TapsellPlus.setDebugMode(3);
this.state = {
Standard: 'tapsell',
Native: 'tapsell',
Interstitial: 'tapsell',
Rewarded: 'tapsell',
};
}
onAdItemClick(name) {
ToastAndroid.show(`Item ${name} was clicked`, ToastAndroid.SHORT);
}
render() {
return <AppStack />;
}
}
const Stack = createStackNavigator();
const AppStack = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Root"
component={RootScreen}
options={{ title: 'Select an Ad type' }}
/>
<Stack.Screen
name="Standard"
component={StandardScreen}
options={{ title: 'Standard banner' }}
/>
<Stack.Screen
name="Interstitial"
component={InterstitialScreen}
options={{ title: 'Interstitial ad' }}
/>
<Stack.Screen
name="Native"
component={NativeScreen}
options={{ title: 'Native ad' }}
/>
<Stack.Screen
name="Rewarded"
component={RewardedScreen}
options={{ title: 'Rewarded ad' }}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
AppRegistry.registerComponent(appName, () => TapsellPlusSample);