tapjoy-react-native-sdk 13.1.2 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +4 -1
- package/android/settings.gradle +1 -1
- package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +281 -24
- package/example/android/app/build.gradle +3 -1
- package/example/android/app/proguard-rules.pro +19 -0
- package/example/android/app/src/main/AndroidManifest.xml +2 -1
- package/example/android/app/src/main/res/xml/network_security_config.xml +12 -0
- package/example/android/settings.gradle +1 -1
- package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +16 -2
- package/example/metro.config.js +10 -2
- package/example/package.json +7 -3
- package/example/src/MainScreen.tsx +52 -46
- package/example/src/OfferwallScreen.tsx +263 -63
- package/example/src/SelectionMenu.tsx +70 -0
- package/example/src/Styles.ts +91 -5
- package/example/src/UserProperties.tsx +246 -8
- package/ios/TapjoyReactNativeSdk.m +17 -1
- package/ios/TapjoyReactNativeSdk.swift +276 -6
- package/lib/commonjs/TJEntryPoint.js +22 -0
- package/lib/commonjs/TJEntryPoint.js.map +1 -0
- package/lib/commonjs/TJPlacement.js +86 -2
- package/lib/commonjs/TJPlacement.js.map +1 -1
- package/lib/commonjs/TJPrivacyPolicy.js +52 -0
- package/lib/commonjs/TJPrivacyPolicy.js.map +1 -1
- package/lib/commonjs/TJSegment.js +16 -0
- package/lib/commonjs/TJSegment.js.map +1 -0
- package/lib/commonjs/TJStatus.js +15 -0
- package/lib/commonjs/TJStatus.js.map +1 -0
- package/lib/commonjs/TJVersion.js +2 -2
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/TJEntryPoint.js +15 -0
- package/lib/module/TJEntryPoint.js.map +1 -0
- package/lib/module/TJPlacement.js +86 -3
- package/lib/module/TJPlacement.js.map +1 -1
- package/lib/module/TJPrivacyPolicy.js +53 -1
- package/lib/module/TJPrivacyPolicy.js.map +1 -1
- package/lib/module/TJSegment.js +9 -0
- package/lib/module/TJSegment.js.map +1 -0
- package/lib/module/TJStatus.js +8 -0
- package/lib/module/TJStatus.js.map +1 -0
- package/lib/module/TJVersion.js +2 -2
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/TJEntryPoint.d.ts +14 -0
- package/lib/typescript/TJEntryPoint.d.ts.map +1 -0
- package/lib/typescript/TJPlacement.d.ts +59 -0
- package/lib/typescript/TJPlacement.d.ts.map +1 -1
- package/lib/typescript/TJPrivacyPolicy.d.ts +9 -0
- package/lib/typescript/TJPrivacyPolicy.d.ts.map +1 -1
- package/lib/typescript/TJSegment.d.ts +8 -0
- package/lib/typescript/TJSegment.d.ts.map +1 -0
- package/lib/typescript/TJStatus.d.ts +7 -0
- package/lib/typescript/TJStatus.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/TJEntryPoint.ts +14 -0
- package/src/TJPlacement.ts +86 -3
- package/src/TJPrivacyPolicy.ts +62 -1
- package/src/TJSegment.ts +8 -0
- package/src/TJStatus.ts +7 -0
- package/src/TJVersion.ts +2 -2
- package/src/index.ts +3 -1
- package/tapjoy-react-native-sdk.podspec +1 -1
package/example/src/Styles.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const styles = StyleSheet.create({
|
|
4
|
+
mainContainer: {
|
|
5
|
+
height: '100%',
|
|
6
|
+
},
|
|
4
7
|
container: {
|
|
5
8
|
flex: 1,
|
|
6
9
|
justifyContent: 'flex-start',
|
|
@@ -24,6 +27,7 @@ const styles = StyleSheet.create({
|
|
|
24
27
|
flexDirection: 'row',
|
|
25
28
|
alignItems: 'flex-start',
|
|
26
29
|
height: 50,
|
|
30
|
+
marginBottom: 10,
|
|
27
31
|
},
|
|
28
32
|
button: {
|
|
29
33
|
backgroundColor: '#FDAA1C',
|
|
@@ -81,6 +85,15 @@ const styles = StyleSheet.create({
|
|
|
81
85
|
flex: 1,
|
|
82
86
|
padding: 3,
|
|
83
87
|
},
|
|
88
|
+
selectionContainer: {
|
|
89
|
+
paddingTop: 10,
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
},
|
|
92
|
+
horizontalContainer: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
marginBottom: 10,
|
|
96
|
+
},
|
|
84
97
|
logText: {
|
|
85
98
|
fontSize: 10,
|
|
86
99
|
fontWeight: 'bold',
|
|
@@ -88,8 +101,9 @@ const styles = StyleSheet.create({
|
|
|
88
101
|
alignSelf: 'stretch',
|
|
89
102
|
},
|
|
90
103
|
versionText: {
|
|
91
|
-
|
|
92
|
-
|
|
104
|
+
textAlign: 'center',
|
|
105
|
+
width: '100%',
|
|
106
|
+
paddingBottom: 5,
|
|
93
107
|
},
|
|
94
108
|
tabBarLabelStyle: {
|
|
95
109
|
fontWeight: '400',
|
|
@@ -107,13 +121,85 @@ const styles = StyleSheet.create({
|
|
|
107
121
|
flexGrow: {
|
|
108
122
|
flexGrow: 1,
|
|
109
123
|
},
|
|
124
|
+
userPropertiesLabel: {
|
|
125
|
+
width: 130,
|
|
126
|
+
paddingRight: 14,
|
|
127
|
+
paddingLeft: 10,
|
|
128
|
+
color: 'black',
|
|
129
|
+
},
|
|
130
|
+
selectedItemText: {
|
|
131
|
+
fontSize: 16,
|
|
132
|
+
marginTop: 20,
|
|
133
|
+
},
|
|
134
|
+
selectionMenuContainer: {
|
|
135
|
+
flex: 1,
|
|
136
|
+
borderWidth: 1,
|
|
137
|
+
borderRadius: 5,
|
|
138
|
+
borderColor: '#ccc',
|
|
139
|
+
overflow: 'hidden',
|
|
140
|
+
},
|
|
141
|
+
item: {
|
|
142
|
+
flexGrow: 1,
|
|
143
|
+
flexShrink: 1,
|
|
144
|
+
paddingVertical: 10,
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
justifyContent: 'center',
|
|
147
|
+
},
|
|
148
|
+
selectedItem: {
|
|
149
|
+
backgroundColor: '#ccc',
|
|
150
|
+
},
|
|
151
|
+
itemText: {
|
|
152
|
+
fontSize: 10,
|
|
153
|
+
color: '#000',
|
|
154
|
+
},
|
|
155
|
+
selectionMenuItemText: {
|
|
156
|
+
color: '#fff',
|
|
157
|
+
fontWeight: 'bold',
|
|
158
|
+
},
|
|
159
|
+
flatListContent: {
|
|
160
|
+
flexGrow: 1,
|
|
161
|
+
},
|
|
162
|
+
offerwallScrollContainer: {
|
|
163
|
+
height: '70%',
|
|
164
|
+
},
|
|
110
165
|
owLogContainer: {
|
|
166
|
+
height: '30%',
|
|
167
|
+
padding: 10,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
export const pickerSelectStyles = StyleSheet.create({
|
|
172
|
+
placeholder: {
|
|
173
|
+
color: '#999999',
|
|
174
|
+
},
|
|
175
|
+
viewContainer: {
|
|
111
176
|
flex: 1,
|
|
112
|
-
|
|
177
|
+
borderWidth: 1,
|
|
178
|
+
borderColor: 'gray',
|
|
179
|
+
borderRadius: 10,
|
|
180
|
+
justifyContent: 'center',
|
|
181
|
+
height: 40,
|
|
113
182
|
},
|
|
114
|
-
|
|
115
|
-
|
|
183
|
+
inputIOS: {
|
|
184
|
+
fontSize: 14,
|
|
185
|
+
paddingVertical: 12,
|
|
186
|
+
paddingHorizontal: 10,
|
|
187
|
+
borderColor: 'gray',
|
|
188
|
+
borderRadius: 10,
|
|
189
|
+
color: 'black',
|
|
190
|
+
paddingRight: 30, // to ensure the text is never behind the icon
|
|
191
|
+
minWidth: 200,
|
|
192
|
+
},
|
|
193
|
+
inputAndroid: {
|
|
194
|
+
height: 40,
|
|
195
|
+
fontSize: 16,
|
|
196
|
+
paddingHorizontal: 10,
|
|
197
|
+
paddingVertical: 8,
|
|
198
|
+
borderWidth: 1,
|
|
199
|
+
borderColor: 'gray',
|
|
200
|
+
borderRadius: 8,
|
|
116
201
|
color: 'black',
|
|
202
|
+
paddingRight: 30, // to ensure the text is never behind the icon
|
|
117
203
|
},
|
|
118
204
|
});
|
|
119
205
|
|
|
@@ -2,25 +2,74 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
TextInput,
|
|
5
|
-
Keyboard,
|
|
6
5
|
Text,
|
|
7
6
|
SafeAreaView,
|
|
8
|
-
|
|
7
|
+
ScrollView,
|
|
8
|
+
Platform,
|
|
9
9
|
} from 'react-native';
|
|
10
10
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
11
11
|
import Button from './Button';
|
|
12
12
|
import styles from './Styles';
|
|
13
|
-
import Tapjoy
|
|
13
|
+
import Tapjoy, {
|
|
14
|
+
TJPrivacyPolicy,
|
|
15
|
+
TJStatus,
|
|
16
|
+
TJSegment,
|
|
17
|
+
} from 'tapjoy-react-native-sdk';
|
|
18
|
+
import SelectionMenu from './SelectionMenu';
|
|
19
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
14
20
|
|
|
15
21
|
const UserProperties: React.FC = () => {
|
|
22
|
+
const NOT_SET_LABEL = 'Not Set';
|
|
23
|
+
|
|
16
24
|
const [statusLabelText, setStatusLabelText] =
|
|
17
25
|
useState<string>('Status Message');
|
|
18
26
|
const [userId, _setUserId] = useState<string>('');
|
|
27
|
+
const [maxLevel, _setMaxLevel] = useState<string>('');
|
|
28
|
+
const [USPrivacy, setUSPrivacy] = useState<string>('');
|
|
29
|
+
const [isSubjectToGDPR, setSubjectToGDPR] = useState<TJStatus>(
|
|
30
|
+
TJStatus.Unknown
|
|
31
|
+
);
|
|
32
|
+
const [isBelowConsentAge, setBelowConsentAge] = useState<TJStatus>(
|
|
33
|
+
TJStatus.Unknown
|
|
34
|
+
);
|
|
35
|
+
const [userConsent, setUserConsent] = useState<TJStatus>(TJStatus.Unknown);
|
|
36
|
+
const [userSegment, setUserSegment] = useState<TJSegment>(TJSegment.Unknown);
|
|
37
|
+
const [optOut, setOptOut] = useState<boolean>(false);
|
|
38
|
+
const isFocused = useIsFocused();
|
|
39
|
+
|
|
40
|
+
const statusData = [
|
|
41
|
+
{ value: TJStatus.True, label: 'True' },
|
|
42
|
+
{ value: TJStatus.False, label: 'False' },
|
|
43
|
+
{ value: TJStatus.Unknown, label: 'Not Set' },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const segmentData = [
|
|
47
|
+
{ value: TJSegment.NonPayer, label: 'Non \nPayer' },
|
|
48
|
+
{ value: TJSegment.Payer, label: 'Payer' },
|
|
49
|
+
{ value: TJSegment.VIP, label: 'VIP' },
|
|
50
|
+
{ value: TJSegment.Unknown, label: 'Unknown' },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const optOutAdData = [
|
|
54
|
+
{ value: true, label: 'True' },
|
|
55
|
+
{ value: false, label: 'False' },
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (isFocused) {
|
|
60
|
+
retrievePrivacyPolicy().then();
|
|
61
|
+
retrieveUserSegment().then();
|
|
62
|
+
}
|
|
63
|
+
}, [isFocused]);
|
|
19
64
|
|
|
20
65
|
useEffect(() => {
|
|
21
66
|
retrieveUserId().then();
|
|
22
67
|
});
|
|
23
68
|
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
retrieveMaxLevel().then();
|
|
71
|
+
});
|
|
72
|
+
|
|
24
73
|
const retrieveUserId = async () => {
|
|
25
74
|
try {
|
|
26
75
|
const value = await AsyncStorage.getItem('userId');
|
|
@@ -32,10 +81,91 @@ const UserProperties: React.FC = () => {
|
|
|
32
81
|
}
|
|
33
82
|
};
|
|
34
83
|
|
|
84
|
+
const retrieveUserSegment = async () => {
|
|
85
|
+
try {
|
|
86
|
+
setUserSegment(await Tapjoy.getUserSegment());
|
|
87
|
+
} catch (error) {
|
|
88
|
+
setStatusLabelText(`Failed to retrieve User Segment: ${error}`);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const retrieveMaxLevel = async () => {
|
|
93
|
+
try {
|
|
94
|
+
const value = await AsyncStorage.getItem('maxLevel');
|
|
95
|
+
if (value !== null) {
|
|
96
|
+
await setMaxLevel(value);
|
|
97
|
+
}
|
|
98
|
+
} catch (error) {
|
|
99
|
+
setStatusLabelText(`Failed to retrieve Max Level: ${error}`);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const retrievePrivacyPolicy = async () => {
|
|
104
|
+
try {
|
|
105
|
+
let privacyPolicy = new TJPrivacyPolicy();
|
|
106
|
+
|
|
107
|
+
setBelowConsentAge(await privacyPolicy.getBelowConsentAge());
|
|
108
|
+
setSubjectToGDPR(await privacyPolicy.getSubjectToGDPR());
|
|
109
|
+
setUserConsent(await privacyPolicy.getUserConsent());
|
|
110
|
+
setUSPrivacy(await privacyPolicy.getUSPrivacy());
|
|
111
|
+
} catch (error) {
|
|
112
|
+
setStatusLabelText(`Failed to retrieve Privacy Policy: ${error}`);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const findStatus = (value: TJStatus) => {
|
|
117
|
+
return (
|
|
118
|
+
statusData.find((item) => item.value === value) || {
|
|
119
|
+
value: TJStatus.Unknown,
|
|
120
|
+
label: NOT_SET_LABEL,
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const findSegment = (value: TJSegment) => {
|
|
126
|
+
return (
|
|
127
|
+
segmentData.find((item) => item.value === value) || {
|
|
128
|
+
value: TJSegment.Unknown,
|
|
129
|
+
label: NOT_SET_LABEL,
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const findOptOut = (value: boolean) => {
|
|
135
|
+
return (
|
|
136
|
+
optOutAdData.find((item) => item.value === value) || {
|
|
137
|
+
value: false,
|
|
138
|
+
label: 'False',
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const initialUserConsentItem = findStatus(userConsent);
|
|
144
|
+
const initialBelowConsentAgeItem = findStatus(isBelowConsentAge);
|
|
145
|
+
const initialSubjectToGDPRItem = findStatus(isSubjectToGDPR);
|
|
146
|
+
const initialUserSegmentItem = findSegment(userSegment);
|
|
147
|
+
const initialOptOutItem = findOptOut(optOut);
|
|
148
|
+
|
|
35
149
|
const applyProperties = async () => {
|
|
36
150
|
try {
|
|
37
151
|
let trimmedUserId = userId.trim();
|
|
152
|
+
let trimmedMaxLevel = maxLevel.trim();
|
|
153
|
+
let maxLevelValue = -1;
|
|
154
|
+
if (trimmedMaxLevel.length > 0) {
|
|
155
|
+
maxLevelValue = parseInt(trimmedMaxLevel);
|
|
156
|
+
}
|
|
157
|
+
let privacyPolicy = new TJPrivacyPolicy();
|
|
158
|
+
privacyPolicy.setSubjectToGDPRStatus(isSubjectToGDPR);
|
|
159
|
+
privacyPolicy.setBelowConsentAgeStatus(isBelowConsentAge);
|
|
160
|
+
privacyPolicy.setUserConsentStatus(userConsent);
|
|
161
|
+
privacyPolicy.setUSPrivacy(USPrivacy);
|
|
162
|
+
if (Platform.OS === 'android') {
|
|
163
|
+
privacyPolicy.optOutAdvertisingID(optOut);
|
|
164
|
+
}
|
|
165
|
+
Tapjoy.setUserSegment(userSegment);
|
|
38
166
|
await AsyncStorage.setItem('userId', trimmedUserId);
|
|
167
|
+
await AsyncStorage.setItem('maxLevel', trimmedMaxLevel);
|
|
168
|
+
await Tapjoy.setMaxLevel(maxLevelValue);
|
|
39
169
|
await Tapjoy.setUserId(trimmedUserId);
|
|
40
170
|
setStatusLabelText(`User ID set:\n"${trimmedUserId}"`);
|
|
41
171
|
} catch (error) {
|
|
@@ -49,22 +179,52 @@ const UserProperties: React.FC = () => {
|
|
|
49
179
|
await AsyncStorage.setItem('userId', trimmedUserId);
|
|
50
180
|
};
|
|
51
181
|
|
|
182
|
+
const setMaxLevel = async (maxLevel: string) => {
|
|
183
|
+
_setMaxLevel(maxLevel);
|
|
184
|
+
let trimmedMaxLevel = maxLevel.trim();
|
|
185
|
+
await AsyncStorage.setItem('maxLevel', trimmedMaxLevel);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const handleUSPrivacy = async (newUSPrivacy: string) => {
|
|
189
|
+
setUSPrivacy(newUSPrivacy);
|
|
190
|
+
};
|
|
191
|
+
|
|
52
192
|
const handleClearInput = async () => {
|
|
53
193
|
await setUserId('');
|
|
54
194
|
};
|
|
55
195
|
|
|
56
|
-
const
|
|
57
|
-
|
|
196
|
+
const handleClearMaxLevel = async () => {
|
|
197
|
+
await setMaxLevel('');
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const handleSubjectToGDPR = (item: { value: TJStatus; label: string }) => {
|
|
201
|
+
setSubjectToGDPR(item.value);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const handleBelowConsentAge = (item: { value: TJStatus; label: string }) => {
|
|
205
|
+
setBelowConsentAge(item.value);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const handleUserConsent = (item: { value: TJStatus; label: string }) => {
|
|
209
|
+
setUserConsent(item.value);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const handleUserSegment = (item: { value: TJSegment; label: string }) => {
|
|
213
|
+
setUserSegment(item.value);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const handleOptOut = (item: { value: boolean; label: string }) => {
|
|
217
|
+
setOptOut(item.value);
|
|
58
218
|
};
|
|
59
219
|
|
|
60
220
|
return (
|
|
61
|
-
<
|
|
221
|
+
<ScrollView>
|
|
62
222
|
<SafeAreaView style={styles.container}>
|
|
63
223
|
<View style={styles.lineGap}>
|
|
64
224
|
<Text style={styles.statusText}>{statusLabelText}</Text>
|
|
65
225
|
</View>
|
|
66
226
|
<View style={styles.inputContainer}>
|
|
67
|
-
<Text style={styles.
|
|
227
|
+
<Text style={styles.userPropertiesLabel}>User ID:</Text>
|
|
68
228
|
<TextInput
|
|
69
229
|
style={styles.textInput}
|
|
70
230
|
value={userId}
|
|
@@ -78,6 +238,84 @@ const UserProperties: React.FC = () => {
|
|
|
78
238
|
title={'\u2573'}
|
|
79
239
|
/>
|
|
80
240
|
</View>
|
|
241
|
+
<View style={styles.inputContainer}>
|
|
242
|
+
<Text style={styles.userPropertiesLabel}>Max Level:</Text>
|
|
243
|
+
<TextInput
|
|
244
|
+
style={styles.textInput}
|
|
245
|
+
value={maxLevel}
|
|
246
|
+
keyboardType={'numeric'}
|
|
247
|
+
onChangeText={setMaxLevel}
|
|
248
|
+
placeholder="Enter max level"
|
|
249
|
+
placeholderTextColor="#888"
|
|
250
|
+
/>
|
|
251
|
+
<Button
|
|
252
|
+
style={styles.clearButton}
|
|
253
|
+
onPress={handleClearMaxLevel}
|
|
254
|
+
title={'\u2573'}
|
|
255
|
+
/>
|
|
256
|
+
</View>
|
|
257
|
+
<View style={styles.selectionContainer}>
|
|
258
|
+
<View style={styles.horizontalContainer}>
|
|
259
|
+
<Text style={styles.userPropertiesLabel}>User Segment:</Text>
|
|
260
|
+
<SelectionMenu
|
|
261
|
+
data={segmentData}
|
|
262
|
+
onSelectItem={handleUserSegment}
|
|
263
|
+
initialSelectedItem={initialUserSegmentItem}
|
|
264
|
+
/>
|
|
265
|
+
</View>
|
|
266
|
+
</View>
|
|
267
|
+
<View style={styles.selectionContainer}>
|
|
268
|
+
<View style={styles.horizontalContainer}>
|
|
269
|
+
<Text style={styles.userPropertiesLabel}>Subject To GDPR:</Text>
|
|
270
|
+
<SelectionMenu
|
|
271
|
+
data={statusData}
|
|
272
|
+
onSelectItem={handleSubjectToGDPR}
|
|
273
|
+
initialSelectedItem={initialSubjectToGDPRItem}
|
|
274
|
+
/>
|
|
275
|
+
</View>
|
|
276
|
+
</View>
|
|
277
|
+
<View style={styles.selectionContainer}>
|
|
278
|
+
<View style={styles.horizontalContainer}>
|
|
279
|
+
<Text style={styles.userPropertiesLabel}>Below Consent Age:</Text>
|
|
280
|
+
<SelectionMenu
|
|
281
|
+
data={statusData}
|
|
282
|
+
onSelectItem={handleBelowConsentAge}
|
|
283
|
+
initialSelectedItem={initialBelowConsentAgeItem}
|
|
284
|
+
/>
|
|
285
|
+
</View>
|
|
286
|
+
</View>
|
|
287
|
+
<View style={styles.selectionContainer}>
|
|
288
|
+
<View style={styles.horizontalContainer}>
|
|
289
|
+
<Text style={styles.userPropertiesLabel}>User Consent:</Text>
|
|
290
|
+
<SelectionMenu
|
|
291
|
+
data={statusData}
|
|
292
|
+
onSelectItem={handleUserConsent}
|
|
293
|
+
initialSelectedItem={initialUserConsentItem}
|
|
294
|
+
/>
|
|
295
|
+
</View>
|
|
296
|
+
</View>
|
|
297
|
+
<View style={styles.inputContainer}>
|
|
298
|
+
<Text style={styles.userPropertiesLabel}>US Privacy:</Text>
|
|
299
|
+
<TextInput
|
|
300
|
+
style={styles.textInput}
|
|
301
|
+
value={USPrivacy}
|
|
302
|
+
onChangeText={handleUSPrivacy}
|
|
303
|
+
placeholder="E.g 1YYN"
|
|
304
|
+
placeholderTextColor="#888"
|
|
305
|
+
/>
|
|
306
|
+
</View>
|
|
307
|
+
{Platform.OS === 'android' && (
|
|
308
|
+
<View style={styles.selectionContainer}>
|
|
309
|
+
<View style={styles.horizontalContainer}>
|
|
310
|
+
<Text style={styles.userPropertiesLabel}>Opt Out Ad ID:</Text>
|
|
311
|
+
<SelectionMenu
|
|
312
|
+
data={optOutAdData}
|
|
313
|
+
onSelectItem={handleOptOut}
|
|
314
|
+
initialSelectedItem={initialOptOutItem}
|
|
315
|
+
/>
|
|
316
|
+
</View>
|
|
317
|
+
</View>
|
|
318
|
+
)}
|
|
81
319
|
<View style={styles.buttonContainer}>
|
|
82
320
|
<Button
|
|
83
321
|
style={styles.button}
|
|
@@ -86,7 +324,7 @@ const UserProperties: React.FC = () => {
|
|
|
86
324
|
/>
|
|
87
325
|
</View>
|
|
88
326
|
</SafeAreaView>
|
|
89
|
-
</
|
|
327
|
+
</ScrollView>
|
|
90
328
|
);
|
|
91
329
|
};
|
|
92
330
|
|
|
@@ -8,12 +8,22 @@ RCT_EXTERN_METHOD(connect:(NSString *)sdkKey connectFlags:(NSDictionary *)connec
|
|
|
8
8
|
RCT_EXTERN_METHOD(setDebugEnabled:(BOOL)enabled)
|
|
9
9
|
RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(isConnected)
|
|
10
10
|
RCT_EXTERN_METHOD(setUserId:(NSString *)userId resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
11
|
+
RCT_EXTERN_METHOD(setUserSegment:(nonnull NSNumber *)userSegment)
|
|
12
|
+
RCT_EXTERN_METHOD(getUserSegment: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
13
|
+
RCT_EXTERN_METHOD(setMaxLevel:(int)maxLevel)
|
|
11
14
|
|
|
12
15
|
#pragma mark - Placements
|
|
16
|
+
RCT_EXTERN_METHOD(createPlacement:(NSString *)name)
|
|
13
17
|
RCT_EXTERN_METHOD(requestPlacement:(NSString *)name)
|
|
14
18
|
RCT_EXTERN_METHOD(showPlacement:(NSString *)name)
|
|
15
19
|
RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(isContentReady:(NSString *)name)
|
|
16
20
|
RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(isContentAvailable:(NSString *)name)
|
|
21
|
+
RCT_EXTERN_METHOD(setEntryPoint:(NSString *)name entryPoint:(nonnull NSNumber *)entryPoint)
|
|
22
|
+
RCT_EXTERN_METHOD(getEntryPoint:(NSString *)name resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
23
|
+
RCT_EXTERN_METHOD(setCurrencyBalance:(NSInteger)amount currencyId:(NSString *)currencyId placementName:(NSString *)placementName resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
24
|
+
RCT_EXTERN_METHOD(getPlacementCurrencyBalance:(NSString *)currencyId placementName:(NSString *)placementName resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
25
|
+
RCT_EXTERN_METHOD(setRequiredAmount:(NSInteger)requiredAmount currencyId:(NSString *)currencyId placementName:(NSString *)placementName resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
26
|
+
RCT_EXTERN_METHOD(getRequiredAmount:(NSString *)currencyId placementName:(NSString *)placementName resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
17
27
|
|
|
18
28
|
#pragma mark - Currency
|
|
19
29
|
RCT_EXTERN_METHOD(getCurrencyBalance:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
@@ -25,7 +35,13 @@ RCT_EXTERN_METHOD(setSubjectToGDPR:(BOOL)isSubjectToGDPR)
|
|
|
25
35
|
RCT_EXTERN_METHOD(setBelowConsentAge:(BOOL)isBelowConsentAge)
|
|
26
36
|
RCT_EXTERN_METHOD(setUSPrivacy:(NSString *)privacyValue)
|
|
27
37
|
RCT_EXTERN_METHOD(setUserConsent:(NSString *)userConsent)
|
|
28
|
-
|
|
38
|
+
RCT_EXTERN_METHOD(setBelowConsentAgeStatus:(nonnull NSNumber *)isBelowConsentAgeStatus)
|
|
39
|
+
RCT_EXTERN_METHOD(setSubjectToGDPRStatus:(nonnull NSNumber *)isSubjectToGDPRStatus)
|
|
40
|
+
RCT_EXTERN_METHOD(setUserConsentStatus:(nonnull NSNumber *)userConsentStatus)
|
|
41
|
+
RCT_EXTERN_METHOD(getBelowConsentAge: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
42
|
+
RCT_EXTERN_METHOD(getSubjectToGDPR: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
43
|
+
RCT_EXTERN_METHOD(getUserConsent: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
44
|
+
RCT_EXTERN_METHOD(getUSPrivacy: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
29
45
|
+ (BOOL)requiresMainQueueSetup
|
|
30
46
|
{
|
|
31
47
|
return NO;
|