tapjoy-react-native-sdk 0.1.0 → 0.1.1

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.
Files changed (84) hide show
  1. package/example/android/app/build.gradle +172 -0
  2. package/example/android/app/debug.keystore +0 -0
  3. package/example/android/app/proguard-rules.pro +10 -0
  4. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  5. package/example/android/app/src/debug/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +75 -0
  6. package/example/android/app/src/main/AndroidManifest.xml +24 -0
  7. package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainActivity.java +35 -0
  8. package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.java +62 -0
  9. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  10. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  11. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  12. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  13. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  14. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  15. package/example/android/app/src/main/res/values/strings.xml +3 -0
  16. package/example/android/app/src/main/res/values/styles.xml +11 -0
  17. package/example/android/app/src/release/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +20 -0
  18. package/example/android/build.gradle +30 -0
  19. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  20. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  21. package/example/android/gradle.properties +44 -0
  22. package/example/android/gradlew +234 -0
  23. package/example/android/gradlew.bat +89 -0
  24. package/example/android/settings.gradle +4 -0
  25. package/example/app.json +4 -0
  26. package/example/babel.config.js +17 -0
  27. package/example/index.js +5 -0
  28. package/example/ios/File.swift +6 -0
  29. package/example/ios/Podfile +63 -0
  30. package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.h +6 -0
  31. package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.mm +36 -0
  32. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/512.imageset/512.png +0 -0
  33. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/512.imageset/Contents.json +21 -0
  34. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/1024.png +0 -0
  35. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/120 1.png +0 -0
  36. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/120.png +0 -0
  37. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/180.png +0 -0
  38. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/40.png +0 -0
  39. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/58.png +0 -0
  40. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/60.png +0 -0
  41. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/80.png +0 -0
  42. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/87.png +0 -0
  43. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  44. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/Contents.json +6 -0
  45. package/example/ios/TapjoyReactNativeSdkExample/Info.plist +59 -0
  46. package/example/ios/TapjoyReactNativeSdkExample/LaunchScreen.storyboard +46 -0
  47. package/example/ios/TapjoyReactNativeSdkExample/main.m +10 -0
  48. package/example/ios/TapjoyReactNativeSdkExample-Bridging-Header.h +3 -0
  49. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +818 -0
  50. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  51. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  52. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/xcshareddata/xcschemes/TapjoyReactNativeSdkExample.xcscheme +88 -0
  53. package/example/ios/TapjoyReactNativeSdkExample.xcworkspace/contents.xcworkspacedata +10 -0
  54. package/example/ios/TapjoyReactNativeSdkExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  55. package/example/ios/TapjoyReactNativeSdkExampleTests/Info.plist +24 -0
  56. package/example/ios/TapjoyReactNativeSdkExampleTests/TapjoyReactNativeSdkExampleTests.m +66 -0
  57. package/example/metro.config.js +40 -0
  58. package/example/package.json +32 -0
  59. package/example/react-native.config.js +10 -0
  60. package/example/src/App.tsx +27 -0
  61. package/example/src/Button.tsx +26 -0
  62. package/example/src/MainScreen.tsx +152 -0
  63. package/example/src/OfferwallScreen.tsx +172 -0
  64. package/example/src/Styles.ts +120 -0
  65. package/example/src/UserProperties.tsx +93 -0
  66. package/example/yarn-error.log +5090 -0
  67. package/example/yarn.lock +5029 -0
  68. package/package.json +15 -5
  69. package/lib/typescript/package/src/TJPlacement.d.ts +0 -17
  70. package/lib/typescript/package/src/TJPlacement.d.ts.map +0 -1
  71. package/lib/typescript/package/src/TJPrivacyPolicy.d.ts +0 -8
  72. package/lib/typescript/package/src/TJPrivacyPolicy.d.ts.map +0 -1
  73. package/lib/typescript/package/src/TJVersion.d.ts +0 -5
  74. package/lib/typescript/package/src/TJVersion.d.ts.map +0 -1
  75. package/lib/typescript/package/src/index.d.ts +0 -7
  76. package/lib/typescript/package/src/index.d.ts.map +0 -1
  77. package/lib/typescript/src/TJPlacement.d.ts +0 -17
  78. package/lib/typescript/src/TJPlacement.d.ts.map +0 -1
  79. package/lib/typescript/src/TJPrivacyPolicy.d.ts +0 -8
  80. package/lib/typescript/src/TJPrivacyPolicy.d.ts.map +0 -1
  81. package/lib/typescript/src/TJVersion.d.ts +0 -5
  82. package/lib/typescript/src/TJVersion.d.ts.map +0 -1
  83. package/lib/typescript/src/index.d.ts +0 -7
  84. package/lib/typescript/src/index.d.ts.map +0 -1
@@ -0,0 +1,120 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ container: {
5
+ flex: 1,
6
+ justifyContent: 'flex-start',
7
+ alignItems: 'center',
8
+ margin: 20,
9
+ },
10
+ inputContainer: {
11
+ flexDirection: 'row',
12
+ alignItems: 'center',
13
+ marginBottom: 20,
14
+ },
15
+ clearButton: {
16
+ flex: 0,
17
+ width: 50,
18
+ backgroundColor: '#FDAA1C',
19
+ borderRadius: 5,
20
+ padding: 10,
21
+ height: 40,
22
+ },
23
+ buttonContainer: {
24
+ flexDirection: 'row',
25
+ alignItems: 'flex-start',
26
+ height: 50,
27
+ },
28
+ button: {
29
+ backgroundColor: '#FDAA1C',
30
+ borderRadius: 5,
31
+ padding: 10,
32
+ flex: 1,
33
+ alignSelf: 'flex-start',
34
+ },
35
+ enabledButton: {},
36
+ disabledButton: {
37
+ opacity: 0.5,
38
+ },
39
+ buttonText: {
40
+ color: '#6A4810',
41
+ fontWeight: 'bold',
42
+ fontSize: 16,
43
+ textAlign: 'center',
44
+ },
45
+ buttonGap: {
46
+ marginRight: 10,
47
+ },
48
+ textInput: {
49
+ flex: 1,
50
+ height: 40,
51
+ borderWidth: 1,
52
+ borderColor: 'gray',
53
+ borderRadius: 10,
54
+ paddingLeft: 10,
55
+ paddingRight: 10,
56
+ marginRight: 10,
57
+ color: 'black',
58
+ },
59
+ statusText: {
60
+ color: 'black',
61
+ textAlign: 'center',
62
+ fontSize: 12,
63
+ },
64
+ labelText: {
65
+ color: 'black',
66
+ alignItems: 'flex-start',
67
+ justifyContent: 'center',
68
+ textAlign: 'left',
69
+ },
70
+ currencyOuterContainer: {
71
+ flex: 1,
72
+ alignItems: 'flex-start',
73
+ justifyContent: 'center',
74
+ },
75
+ currencyInnerContainer: {
76
+ flex: 1,
77
+ flexDirection: 'row',
78
+ marginTop: 10,
79
+ },
80
+ currencyButtonContainer: {
81
+ flex: 1,
82
+ padding: 3,
83
+ },
84
+ logText: {
85
+ fontSize: 10,
86
+ fontWeight: 'bold',
87
+ textAlign: 'left',
88
+ alignSelf: 'stretch',
89
+ },
90
+ versionText: {
91
+ position: 'absolute',
92
+ bottom: 0,
93
+ },
94
+ tabBarLabelStyle: {
95
+ fontWeight: '400',
96
+ fontSize: 10,
97
+ },
98
+ tabBarIconStyle: {
99
+ display: 'none',
100
+ },
101
+ lineGap: {
102
+ marginBottom: 10,
103
+ },
104
+ zeroFlex: {
105
+ flex: 0,
106
+ },
107
+ flexGrow: {
108
+ flexGrow: 1,
109
+ },
110
+ owLogContainer: {
111
+ flex: 1,
112
+ alignSelf: 'stretch',
113
+ },
114
+ userIdLabel: {
115
+ paddingRight: 14,
116
+ color: 'black',
117
+ },
118
+ });
119
+
120
+ export default styles;
@@ -0,0 +1,93 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import {
3
+ View,
4
+ TextInput,
5
+ Keyboard,
6
+ Text,
7
+ SafeAreaView,
8
+ TouchableWithoutFeedback,
9
+ } from 'react-native';
10
+ import AsyncStorage from '@react-native-async-storage/async-storage';
11
+ import Button from './Button';
12
+ import styles from './Styles';
13
+ import Tapjoy from 'tapjoy-react-native-sdk';
14
+
15
+ const UserProperties: React.FC = () => {
16
+ const [statusLabelText, setStatusLabelText] =
17
+ useState<string>('Status Message');
18
+ const [userId, _setUserId] = useState<string>('');
19
+
20
+ useEffect(() => {
21
+ retrieveUserId().then();
22
+ });
23
+
24
+ const retrieveUserId = async () => {
25
+ try {
26
+ const value = await AsyncStorage.getItem('userId');
27
+ if (value !== null) {
28
+ await setUserId(value);
29
+ }
30
+ } catch (error) {
31
+ setStatusLabelText(`Failed to retrieve User ID: ${error}`);
32
+ }
33
+ };
34
+
35
+ const applyProperties = async () => {
36
+ try {
37
+ let trimmedUserId = userId.trim();
38
+ await AsyncStorage.setItem('userId', trimmedUserId);
39
+ await Tapjoy.setUserId(trimmedUserId);
40
+ setStatusLabelText(`User ID set:\n"${trimmedUserId}"`);
41
+ } catch (error) {
42
+ setStatusLabelText(`Set properties error: ${error}`);
43
+ }
44
+ };
45
+
46
+ const setUserId = async (newUserId: string) => {
47
+ _setUserId(newUserId);
48
+ let trimmedUserId = newUserId.trim();
49
+ await AsyncStorage.setItem('userId', trimmedUserId);
50
+ };
51
+
52
+ const handleClearInput = async () => {
53
+ await setUserId('');
54
+ };
55
+
56
+ const handleDismissKeyboard = () => {
57
+ Keyboard.dismiss();
58
+ };
59
+
60
+ return (
61
+ <TouchableWithoutFeedback onPress={handleDismissKeyboard}>
62
+ <SafeAreaView style={styles.container}>
63
+ <View style={styles.lineGap}>
64
+ <Text style={styles.statusText}>{statusLabelText}</Text>
65
+ </View>
66
+ <View style={styles.inputContainer}>
67
+ <Text style={styles.userIdLabel}>User ID:</Text>
68
+ <TextInput
69
+ style={styles.textInput}
70
+ value={userId}
71
+ onChangeText={setUserId}
72
+ placeholder="Enter user ID"
73
+ placeholderTextColor="#888"
74
+ />
75
+ <Button
76
+ style={styles.clearButton}
77
+ onPress={handleClearInput}
78
+ title={'\u2573'}
79
+ />
80
+ </View>
81
+ <View style={styles.buttonContainer}>
82
+ <Button
83
+ style={styles.button}
84
+ onPress={applyProperties}
85
+ title={'Apply'}
86
+ />
87
+ </View>
88
+ </SafeAreaView>
89
+ </TouchableWithoutFeedback>
90
+ );
91
+ };
92
+
93
+ export default UserProperties;