tapjoy-react-native-sdk 14.4.0 → 14.5.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 +3 -3
- package/android/gradle.properties +3 -3
- package/android/src/main/java/com/tapjoyreactnativesdk/TJOfferwallDiscoverNativeView.kt +2 -2
- package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +18 -13
- package/example/android/app/build.gradle +1 -1
- package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.kt +2 -8
- package/example/android/build.gradle +4 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +5 -0
- package/example/ios/TapjoyReactNativeSdkExample/Info.plist +1 -1
- package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +0 -45
- package/example/metro.config.js +9 -15
- package/example/package.json +16 -15
- package/example/src/App.tsx +1 -2
- package/example/src/MainScreen.tsx +75 -60
- package/example/src/OfferwallDiscoverScreen.tsx +105 -91
- package/example/src/OfferwallScreen.tsx +170 -156
- package/example/src/Styles.ts +3 -2
- package/example/src/UserProperties.tsx +150 -135
- package/lib/commonjs/TJVersion.js +1 -1
- package/package.json +8 -15
- package/src/TJVersion.ts +1 -1
- package/tapjoy-react-native-sdk.podspec +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState, useContext } from 'react';
|
|
2
|
-
import { useFocusEffect } from '@react-navigation/native';
|
|
3
2
|
import {
|
|
4
3
|
FlatList,
|
|
5
|
-
SafeAreaView,
|
|
6
4
|
ScrollView,
|
|
7
5
|
Text,
|
|
8
6
|
TextInput,
|
|
9
7
|
View,
|
|
10
8
|
Dimensions,
|
|
11
9
|
} from 'react-native';
|
|
12
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
SafeAreaProvider,
|
|
12
|
+
useSafeAreaInsets,
|
|
13
|
+
} from 'react-native-safe-area-context';
|
|
14
|
+
import { TJOfferwallDiscoverView } from 'tapjoy-react-native-sdk';
|
|
13
15
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
14
16
|
import dayjs from 'dayjs';
|
|
15
17
|
import Button from './Button';
|
|
@@ -88,100 +90,112 @@ const OfferwallDiscoverScreen: React.FC = () => {
|
|
|
88
90
|
};
|
|
89
91
|
};
|
|
90
92
|
|
|
93
|
+
const safeAreaInsets = useSafeAreaInsets();
|
|
94
|
+
|
|
91
95
|
return (
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
<SafeAreaProvider>
|
|
97
|
+
<View style={[
|
|
98
|
+
styles.mainContainer,
|
|
99
|
+
{
|
|
100
|
+
paddingTop: safeAreaInsets.top,
|
|
101
|
+
paddingBottom: safeAreaInsets.bottom,
|
|
102
|
+
paddingLeft: safeAreaInsets.left,
|
|
103
|
+
paddingRight: safeAreaInsets.right,
|
|
104
|
+
},
|
|
105
|
+
]}>
|
|
106
|
+
<ScrollView style={styles.offerwallScrollContainer}>
|
|
107
|
+
<View style={styles.container}>
|
|
108
|
+
<View style={styles.inputContainer}>
|
|
109
|
+
<Text style={styles.textInputLabel}>Width</Text>
|
|
110
|
+
<TextInput
|
|
111
|
+
keyboardType="numeric"
|
|
112
|
+
style={styles.textInput}
|
|
113
|
+
onChangeText={(value) => {
|
|
114
|
+
value = stripNonNumericValue(value);
|
|
115
|
+
setWidth(value);
|
|
116
|
+
widthChangedManually.current = true;
|
|
117
|
+
}}
|
|
118
|
+
value={width}
|
|
119
|
+
autoCorrect={false}
|
|
120
|
+
placeholderTextColor="#888"
|
|
121
|
+
autoCapitalize="none"
|
|
122
|
+
/>
|
|
123
|
+
<Text style={[styles.textInputLabel, styles.leftSpacing]}>
|
|
124
|
+
Height
|
|
125
|
+
</Text>
|
|
126
|
+
<TextInput
|
|
127
|
+
keyboardType="numeric"
|
|
128
|
+
style={styles.textInput}
|
|
129
|
+
onChangeText={(value) => {
|
|
130
|
+
value = stripNonNumericValue(value);
|
|
131
|
+
setHeight(value);
|
|
132
|
+
}}
|
|
133
|
+
value={height.replace(/\D/g, '')}
|
|
134
|
+
autoCorrect={false}
|
|
135
|
+
placeholderTextColor="#888"
|
|
136
|
+
autoCapitalize="none"
|
|
137
|
+
/>
|
|
138
|
+
</View>
|
|
139
|
+
<View style={styles.inputContainer}>
|
|
140
|
+
<TextInput
|
|
141
|
+
style={styles.textInput}
|
|
142
|
+
value={offerwallPlacementName}
|
|
143
|
+
onChangeText={setOfferwallPlacementName}
|
|
144
|
+
autoCorrect={false}
|
|
145
|
+
placeholder="Enter Placement Name"
|
|
146
|
+
placeholderTextColor="#888"
|
|
147
|
+
autoCapitalize="none"
|
|
148
|
+
/>
|
|
149
|
+
<Button
|
|
150
|
+
style={styles.clearButton}
|
|
151
|
+
onPress={handleClearInput}
|
|
152
|
+
title={'\u2573'}
|
|
153
|
+
/>
|
|
154
|
+
</View>
|
|
155
|
+
<View style={styles.buttonContainer}>
|
|
156
|
+
<Button
|
|
157
|
+
onPress={loadContent}
|
|
158
|
+
disabled={!isSdkConnected}
|
|
159
|
+
title={'Request'}
|
|
160
|
+
/>
|
|
161
|
+
<View style={styles.buttonGap} />
|
|
162
|
+
<Button onPress={clearContent} title={'Clear'} />
|
|
163
|
+
</View>
|
|
164
|
+
<TJOfferwallDiscoverView
|
|
165
|
+
ref={owdRef}
|
|
166
|
+
style={getViewStyle()}
|
|
167
|
+
onRequestSuccess={(event: any) => {
|
|
168
|
+
addLogItem(event.nativeEvent.result);
|
|
119
169
|
}}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
170
|
+
onRequestFailure={(event: any) =>
|
|
171
|
+
addLogItem(
|
|
172
|
+
`requestFailure: code:${event.nativeEvent.errorCode}, message:${event.nativeEvent.errorMessage}`
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
onContentReady={(event: any) =>
|
|
176
|
+
addLogItem(event.nativeEvent.result)
|
|
177
|
+
}
|
|
178
|
+
onContentError={(event: any) =>
|
|
179
|
+
addLogItem(
|
|
180
|
+
`contentError: code:${event.nativeEvent.errorCode}, message:${event.nativeEvent.errorMessage}`
|
|
181
|
+
)
|
|
182
|
+
}
|
|
124
183
|
/>
|
|
125
184
|
</View>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<Button
|
|
137
|
-
style={styles.clearButton}
|
|
138
|
-
onPress={handleClearInput}
|
|
139
|
-
title={'\u2573'}
|
|
140
|
-
/>
|
|
141
|
-
</View>
|
|
142
|
-
<View style={styles.buttonContainer}>
|
|
143
|
-
<Button
|
|
144
|
-
onPress={loadContent}
|
|
145
|
-
disabled={!isSdkConnected}
|
|
146
|
-
title={'Request'}
|
|
147
|
-
/>
|
|
148
|
-
<View style={styles.buttonGap} />
|
|
149
|
-
<Button onPress={clearContent} title={'Clear'} />
|
|
150
|
-
</View>
|
|
151
|
-
<TJOfferwallDiscoverView
|
|
152
|
-
ref={owdRef}
|
|
153
|
-
style={getViewStyle()}
|
|
154
|
-
onRequestSuccess={(event: any) => {
|
|
155
|
-
addLogItem(event.nativeEvent.result);
|
|
156
|
-
}}
|
|
157
|
-
onRequestFailure={(event: any) =>
|
|
158
|
-
addLogItem(
|
|
159
|
-
`requestFailure: code:${event.nativeEvent.errorCode}, message:${event.nativeEvent.errorMessage}`
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
onContentReady={(event: any) =>
|
|
163
|
-
addLogItem(event.nativeEvent.result)
|
|
164
|
-
}
|
|
165
|
-
onContentError={(event: any) =>
|
|
166
|
-
addLogItem(
|
|
167
|
-
`contentError: code:${event.nativeEvent.errorCode}, message:${event.nativeEvent.errorMessage}`
|
|
168
|
-
)
|
|
169
|
-
}
|
|
185
|
+
</ScrollView>
|
|
186
|
+
<View style={styles.owLogContainer}>
|
|
187
|
+
<FlatList
|
|
188
|
+
data={logData}
|
|
189
|
+
renderItem={({ item }) => (
|
|
190
|
+
<View>
|
|
191
|
+
<Text style={styles.logText}>{item}</Text>
|
|
192
|
+
</View>
|
|
193
|
+
)}
|
|
194
|
+
keyExtractor={(_item, index) => index.toString()}
|
|
170
195
|
/>
|
|
171
|
-
</
|
|
172
|
-
</ScrollView>
|
|
173
|
-
<View style={styles.owLogContainer}>
|
|
174
|
-
<FlatList
|
|
175
|
-
data={logData}
|
|
176
|
-
renderItem={({ item }) => (
|
|
177
|
-
<View>
|
|
178
|
-
<Text style={styles.logText}>{item}</Text>
|
|
179
|
-
</View>
|
|
180
|
-
)}
|
|
181
|
-
keyExtractor={(_item, index) => index.toString()}
|
|
182
|
-
/>
|
|
196
|
+
</View>
|
|
183
197
|
</View>
|
|
184
|
-
</
|
|
198
|
+
</SafeAreaProvider>
|
|
185
199
|
);
|
|
186
200
|
};
|
|
187
201
|
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React, { useEffect, useState, useContext } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
FlatList,
|
|
4
|
-
SafeAreaView,
|
|
5
4
|
ScrollView,
|
|
6
5
|
Text,
|
|
7
6
|
TextInput,
|
|
8
7
|
View,
|
|
9
8
|
} from 'react-native';
|
|
9
|
+
import {
|
|
10
|
+
SafeAreaProvider,
|
|
11
|
+
useSafeAreaInsets,
|
|
12
|
+
} from 'react-native-safe-area-context';
|
|
10
13
|
import dayjs from 'dayjs';
|
|
11
14
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
12
15
|
import Button from './Button';
|
|
13
16
|
import styles, { pickerSelectStyles } from './Styles';
|
|
14
|
-
import {TJPlacement, TJPurchase } from 'tapjoy-react-native-sdk';
|
|
17
|
+
import { TJPlacement, TJPurchase } from 'tapjoy-react-native-sdk';
|
|
15
18
|
import RNPickerSelect from 'react-native-picker-select';
|
|
16
19
|
import TJEntryPoint from '../../src/TJEntryPoint';
|
|
17
20
|
import { ConnectContext } from './ConnectContext';
|
|
@@ -55,7 +58,7 @@ const OfferwallScreen: React.FC = () => {
|
|
|
55
58
|
|
|
56
59
|
useEffect(() => {
|
|
57
60
|
retrievePurchaseCode().then();
|
|
58
|
-
});
|
|
61
|
+
});
|
|
59
62
|
|
|
60
63
|
const retrieveStoredPlacementName = () => {
|
|
61
64
|
AsyncStorage.getItem('placementName').then(async (value) => {
|
|
@@ -106,19 +109,19 @@ const OfferwallScreen: React.FC = () => {
|
|
|
106
109
|
}
|
|
107
110
|
} catch (error) {
|
|
108
111
|
addLogItem(`Failed to retrieve purchase amount: ${error}`);
|
|
109
|
-
|
|
110
|
-
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
111
114
|
|
|
112
|
-
const retrievePurchaseCode = async () => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
const retrievePurchaseCode = async () => {
|
|
116
|
+
try {
|
|
117
|
+
const value = await AsyncStorage.getItem('purchaseCode');
|
|
118
|
+
if (value !== null) {
|
|
119
|
+
await setPurchaseCode(value);
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
addLogItem(`Failed to retrieve purchase amount: ${error}`);
|
|
117
123
|
}
|
|
118
|
-
}
|
|
119
|
-
addLogItem(`Failed to retrieve purchase amount: ${error}`);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
124
|
+
};
|
|
122
125
|
|
|
123
126
|
const setCurrencyId = async (id: string) => {
|
|
124
127
|
_setCurrencyId(id);
|
|
@@ -178,7 +181,7 @@ const retrievePurchaseCode = async () => {
|
|
|
178
181
|
);
|
|
179
182
|
addLogItem(
|
|
180
183
|
'setCurrencyBalance: ' +
|
|
181
|
-
|
|
184
|
+
(await offerwallPlacement?.getCurrencyBalance(currencyId))
|
|
182
185
|
);
|
|
183
186
|
} catch (e: any) {
|
|
184
187
|
addLogItem(`currencyBalanceError: ${e.code} - ${e.message}`);
|
|
@@ -193,9 +196,9 @@ const retrievePurchaseCode = async () => {
|
|
|
193
196
|
);
|
|
194
197
|
addLogItem(
|
|
195
198
|
'setCurrencyRequiredAmount: ' +
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
+
JSON.stringify(
|
|
200
|
+
await offerwallPlacement?.getRequiredAmount(currencyId)
|
|
201
|
+
)
|
|
199
202
|
);
|
|
200
203
|
} catch (e: any) {
|
|
201
204
|
addLogItem(`requiredAmountError: ${e.code} - ${e.message}`);
|
|
@@ -223,8 +226,7 @@ const retrievePurchaseCode = async () => {
|
|
|
223
226
|
TJPlacement.REQUEST_DID_FAIL,
|
|
224
227
|
(placement: TJPlacement) => {
|
|
225
228
|
addLogItem(
|
|
226
|
-
`${TJPlacement.REQUEST_DID_FAIL} "${placement.name}" - ${
|
|
227
|
-
placement.error !== undefined ? placement.error : ''
|
|
229
|
+
`${TJPlacement.REQUEST_DID_FAIL} "${placement.name}" - ${placement.error !== undefined ? placement.error : ''
|
|
228
230
|
}`
|
|
229
231
|
);
|
|
230
232
|
setPlacementState('failed');
|
|
@@ -302,145 +304,157 @@ const retrievePurchaseCode = async () => {
|
|
|
302
304
|
{ label: 'Store', value: TJEntryPoint.TJEntryPointStore },
|
|
303
305
|
];
|
|
304
306
|
|
|
307
|
+
const safeAreaInsets = useSafeAreaInsets();
|
|
308
|
+
|
|
305
309
|
return (
|
|
306
|
-
<
|
|
307
|
-
<
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
offerwallPlacement?.setEntryPoint(value);
|
|
347
|
-
setEntryPoint(value);
|
|
348
|
-
}}
|
|
349
|
-
items={entryPointArray}
|
|
350
|
-
style={pickerSelectStyles}
|
|
351
|
-
useNativeAndroidPickerStyle={false}
|
|
352
|
-
touchableWrapperProps={{ style: { flex: 1 } }}
|
|
353
|
-
/>
|
|
354
|
-
</View>
|
|
355
|
-
<View style={styles.inputContainer}>
|
|
356
|
-
<Text style={styles.userPropertiesLabel}>Currency ID:</Text>
|
|
357
|
-
<TextInput
|
|
358
|
-
style={styles.textInput}
|
|
359
|
-
value={currencyId}
|
|
360
|
-
keyboardType={'default'}
|
|
361
|
-
onChangeText={setCurrencyId}
|
|
362
|
-
placeholder="Enter Currency ID."
|
|
363
|
-
placeholderTextColor="#888"
|
|
364
|
-
/>
|
|
365
|
-
<Button
|
|
366
|
-
style={styles.clearButton}
|
|
367
|
-
onPress={handleClearCurrencyId}
|
|
368
|
-
title={'\u2573'}
|
|
369
|
-
/>
|
|
370
|
-
</View>
|
|
371
|
-
<View style={styles.inputContainer}>
|
|
372
|
-
<Text style={styles.userPropertiesLabel}>Currency Balance:</Text>
|
|
373
|
-
<TextInput
|
|
374
|
-
style={styles.textInput}
|
|
375
|
-
value={currencyBalance}
|
|
376
|
-
keyboardType={'numeric'}
|
|
377
|
-
onChangeText={setCurrencyBalance}
|
|
378
|
-
placeholder="Enter Currency Balance."
|
|
379
|
-
placeholderTextColor="#888"
|
|
380
|
-
/>
|
|
381
|
-
<Button
|
|
382
|
-
style={styles.clearButton}
|
|
383
|
-
onPress={handleClearCurrencyBalance}
|
|
384
|
-
title={'\u2573'}
|
|
385
|
-
/>
|
|
386
|
-
</View>
|
|
387
|
-
<View style={styles.inputContainer}>
|
|
388
|
-
<Text style={styles.userPropertiesLabel}>Required Amount:</Text>
|
|
389
|
-
<TextInput
|
|
390
|
-
style={styles.textInput}
|
|
391
|
-
value={requiredAmount}
|
|
392
|
-
keyboardType={'numeric'}
|
|
393
|
-
onChangeText={setRequiredAmount}
|
|
394
|
-
placeholder="Enter Required Amount."
|
|
395
|
-
placeholderTextColor="#888"
|
|
396
|
-
/>
|
|
397
|
-
<Button
|
|
398
|
-
style={styles.clearButton}
|
|
399
|
-
onPress={handleClearRequiredAmount}
|
|
400
|
-
title={'\u2573'}
|
|
401
|
-
/>
|
|
402
|
-
</View>
|
|
403
|
-
<View style={styles.inputContainer}>
|
|
404
|
-
<Text style={styles.purchaseCurrencyLabel}>Purchase Amount:</Text>
|
|
405
|
-
<TextInput
|
|
406
|
-
style={styles.textInput}
|
|
407
|
-
value={purchaseAmount}
|
|
408
|
-
keyboardType={'numeric'}
|
|
409
|
-
onChangeText={setPurchaseAmount}
|
|
410
|
-
placeholder="E.g. 0.99"
|
|
411
|
-
placeholderTextColor="#888"
|
|
412
|
-
/>
|
|
413
|
-
<Text style={styles.purchaseCurrencyLabel}>Purchase Code:</Text>
|
|
414
|
-
<TextInput
|
|
415
|
-
style={styles.textInput}
|
|
416
|
-
value={purchaseCode}
|
|
417
|
-
keyboardType={'default'}
|
|
418
|
-
onChangeText={setPurchaseCode}
|
|
419
|
-
placeholder="E.g. USD."
|
|
420
|
-
placeholderTextColor="#888"
|
|
421
|
-
/>
|
|
422
|
-
</View>
|
|
423
|
-
<View style={styles.buttonContainer}>
|
|
424
|
-
<Button
|
|
425
|
-
onPress={sendPurchaseAction}
|
|
426
|
-
disabled={!isSdkConnected}
|
|
427
|
-
title={'Purchase'}
|
|
428
|
-
/>
|
|
429
|
-
</View>
|
|
430
|
-
</SafeAreaView>
|
|
431
|
-
</ScrollView>
|
|
432
|
-
<View style={styles.owLogContainer}>
|
|
433
|
-
<FlatList
|
|
434
|
-
data={logData}
|
|
435
|
-
renderItem={({ item }) => (
|
|
436
|
-
<View>
|
|
437
|
-
<Text style={styles.logText}>{item}</Text>
|
|
310
|
+
<SafeAreaProvider>
|
|
311
|
+
<View style={[
|
|
312
|
+
styles.mainContainer,
|
|
313
|
+
{
|
|
314
|
+
paddingTop: safeAreaInsets.top,
|
|
315
|
+
paddingBottom: safeAreaInsets.bottom,
|
|
316
|
+
paddingLeft: safeAreaInsets.left,
|
|
317
|
+
paddingRight: safeAreaInsets.right,
|
|
318
|
+
},
|
|
319
|
+
]}>
|
|
320
|
+
<ScrollView style={styles.offerwallScrollContainer}>
|
|
321
|
+
<View style={styles.container}>
|
|
322
|
+
<View style={styles.inputContainer}>
|
|
323
|
+
<TextInput
|
|
324
|
+
style={styles.textInput}
|
|
325
|
+
value={offerwallPlacementName}
|
|
326
|
+
onChangeText={setOfferwallPlacementName}
|
|
327
|
+
autoCorrect={false}
|
|
328
|
+
placeholder="Enter Placement Name"
|
|
329
|
+
placeholderTextColor="#888"
|
|
330
|
+
autoCapitalize="none"
|
|
331
|
+
/>
|
|
332
|
+
<Button
|
|
333
|
+
style={[styles.clearButton, styles.leftSpacing]}
|
|
334
|
+
onPress={handleClearInput}
|
|
335
|
+
title={'\u2573'}
|
|
336
|
+
/>
|
|
337
|
+
</View>
|
|
338
|
+
<View style={styles.buttonContainer}>
|
|
339
|
+
<Button
|
|
340
|
+
onPress={loadPlacement}
|
|
341
|
+
disabled={!isSdkConnected}
|
|
342
|
+
title={'Request'}
|
|
343
|
+
/>
|
|
344
|
+
<View style={styles.buttonGap} />
|
|
345
|
+
<Button
|
|
346
|
+
onPress={showPlacement}
|
|
347
|
+
disabled={!(placementState === 'ready')}
|
|
348
|
+
title={'Display'}
|
|
349
|
+
/>
|
|
438
350
|
</View>
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
351
|
+
<View style={styles.inputContainer}>
|
|
352
|
+
<Text style={styles.userPropertiesLabel}>Entry Point: </Text>
|
|
353
|
+
<RNPickerSelect
|
|
354
|
+
placeholder={{
|
|
355
|
+
label: 'Select Entry Point...',
|
|
356
|
+
value: TJEntryPoint.TJEntryPointUnknown,
|
|
357
|
+
}}
|
|
358
|
+
onValueChange={async (value: any) => {
|
|
359
|
+
offerwallPlacement?.setEntryPoint(value);
|
|
360
|
+
setEntryPoint(value);
|
|
361
|
+
}}
|
|
362
|
+
items={entryPointArray}
|
|
363
|
+
style={pickerSelectStyles}
|
|
364
|
+
useNativeAndroidPickerStyle={false}
|
|
365
|
+
touchableWrapperProps={{ style: { flex: 1 } }}
|
|
366
|
+
/>
|
|
367
|
+
</View>
|
|
368
|
+
<View style={styles.inputContainer}>
|
|
369
|
+
<Text style={styles.userPropertiesLabel}>Currency ID:</Text>
|
|
370
|
+
<TextInput
|
|
371
|
+
style={styles.textInput}
|
|
372
|
+
value={currencyId}
|
|
373
|
+
keyboardType={'default'}
|
|
374
|
+
onChangeText={setCurrencyId}
|
|
375
|
+
placeholder="Enter Currency ID."
|
|
376
|
+
placeholderTextColor="#888"
|
|
377
|
+
/>
|
|
378
|
+
<Button
|
|
379
|
+
style={styles.clearButton}
|
|
380
|
+
onPress={handleClearCurrencyId}
|
|
381
|
+
title={'\u2573'}
|
|
382
|
+
/>
|
|
383
|
+
</View>
|
|
384
|
+
<View style={styles.inputContainer}>
|
|
385
|
+
<Text style={styles.userPropertiesLabel}>Currency Balance:</Text>
|
|
386
|
+
<TextInput
|
|
387
|
+
style={styles.textInput}
|
|
388
|
+
value={currencyBalance}
|
|
389
|
+
keyboardType={'numeric'}
|
|
390
|
+
onChangeText={setCurrencyBalance}
|
|
391
|
+
placeholder="Enter Currency Balance."
|
|
392
|
+
placeholderTextColor="#888"
|
|
393
|
+
/>
|
|
394
|
+
<Button
|
|
395
|
+
style={styles.clearButton}
|
|
396
|
+
onPress={handleClearCurrencyBalance}
|
|
397
|
+
title={'\u2573'}
|
|
398
|
+
/>
|
|
399
|
+
</View>
|
|
400
|
+
<View style={styles.inputContainer}>
|
|
401
|
+
<Text style={styles.userPropertiesLabel}>Required Amount:</Text>
|
|
402
|
+
<TextInput
|
|
403
|
+
style={styles.textInput}
|
|
404
|
+
value={requiredAmount}
|
|
405
|
+
keyboardType={'numeric'}
|
|
406
|
+
onChangeText={setRequiredAmount}
|
|
407
|
+
placeholder="Enter Required Amount."
|
|
408
|
+
placeholderTextColor="#888"
|
|
409
|
+
/>
|
|
410
|
+
<Button
|
|
411
|
+
style={styles.clearButton}
|
|
412
|
+
onPress={handleClearRequiredAmount}
|
|
413
|
+
title={'\u2573'}
|
|
414
|
+
/>
|
|
415
|
+
</View>
|
|
416
|
+
<View style={styles.inputContainer}>
|
|
417
|
+
<Text style={styles.purchaseCurrencyLabel}>Purchase Amount:</Text>
|
|
418
|
+
<TextInput
|
|
419
|
+
style={styles.textInput}
|
|
420
|
+
value={purchaseAmount}
|
|
421
|
+
keyboardType={'numeric'}
|
|
422
|
+
onChangeText={setPurchaseAmount}
|
|
423
|
+
placeholder="E.g. 0.99"
|
|
424
|
+
placeholderTextColor="#888"
|
|
425
|
+
/>
|
|
426
|
+
<Text style={styles.purchaseCurrencyLabel}>Purchase Code:</Text>
|
|
427
|
+
<TextInput
|
|
428
|
+
style={styles.textInput}
|
|
429
|
+
value={purchaseCode}
|
|
430
|
+
keyboardType={'default'}
|
|
431
|
+
onChangeText={setPurchaseCode}
|
|
432
|
+
placeholder="E.g. USD."
|
|
433
|
+
placeholderTextColor="#888"
|
|
434
|
+
/>
|
|
435
|
+
</View>
|
|
436
|
+
<View style={styles.buttonContainer}>
|
|
437
|
+
<Button
|
|
438
|
+
onPress={sendPurchaseAction}
|
|
439
|
+
disabled={!isSdkConnected}
|
|
440
|
+
title={'Purchase'}
|
|
441
|
+
/>
|
|
442
|
+
</View>
|
|
443
|
+
</View>
|
|
444
|
+
</ScrollView>
|
|
445
|
+
<View style={styles.owLogContainer}>
|
|
446
|
+
<FlatList
|
|
447
|
+
data={logData}
|
|
448
|
+
renderItem={({ item }) => (
|
|
449
|
+
<View>
|
|
450
|
+
<Text style={styles.logText}>{item}</Text>
|
|
451
|
+
</View>
|
|
452
|
+
)}
|
|
453
|
+
keyExtractor={(_item, index) => index.toString()}
|
|
454
|
+
/>
|
|
455
|
+
</View>
|
|
442
456
|
</View>
|
|
443
|
-
</
|
|
457
|
+
</SafeAreaProvider>
|
|
444
458
|
);
|
|
445
459
|
};
|
|
446
460
|
|
package/example/src/Styles.ts
CHANGED
|
@@ -189,10 +189,11 @@ const styles = StyleSheet.create({
|
|
|
189
189
|
flexGrow: 1,
|
|
190
190
|
},
|
|
191
191
|
offerwallScrollContainer: {
|
|
192
|
-
|
|
192
|
+
flex: 1,
|
|
193
|
+
height: '80%',
|
|
193
194
|
},
|
|
194
195
|
owLogContainer: {
|
|
195
|
-
height: '
|
|
196
|
+
height: '20%',
|
|
196
197
|
padding: 10,
|
|
197
198
|
backgroundColor: '#DDDDDD',
|
|
198
199
|
},
|