tapjoy-react-native-sdk 0.1.0 → 0.1.2

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 (82) hide show
  1. package/README.md +2 -2
  2. package/example/android/app/build.gradle +172 -0
  3. package/example/android/app/debug.keystore +0 -0
  4. package/example/android/app/proguard-rules.pro +10 -0
  5. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  6. package/example/android/app/src/debug/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +75 -0
  7. package/example/android/app/src/main/AndroidManifest.xml +24 -0
  8. package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainActivity.java +35 -0
  9. package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.java +62 -0
  10. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  11. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  12. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  13. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  14. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  15. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  16. package/example/android/app/src/main/res/values/strings.xml +3 -0
  17. package/example/android/app/src/main/res/values/styles.xml +11 -0
  18. package/example/android/app/src/release/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +20 -0
  19. package/example/android/build.gradle +30 -0
  20. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  21. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  22. package/example/android/gradle.properties +44 -0
  23. package/example/android/gradlew +234 -0
  24. package/example/android/gradlew.bat +89 -0
  25. package/example/android/settings.gradle +4 -0
  26. package/example/app.json +4 -0
  27. package/example/babel.config.js +17 -0
  28. package/example/index.js +5 -0
  29. package/example/ios/File.swift +6 -0
  30. package/example/ios/Podfile +63 -0
  31. package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.h +6 -0
  32. package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.mm +36 -0
  33. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/512.imageset/512.png +0 -0
  34. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/512.imageset/Contents.json +21 -0
  35. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/1024.png +0 -0
  36. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/120 1.png +0 -0
  37. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/120.png +0 -0
  38. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/180.png +0 -0
  39. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/40.png +0 -0
  40. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/58.png +0 -0
  41. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/60.png +0 -0
  42. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/80.png +0 -0
  43. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/87.png +0 -0
  44. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  45. package/example/ios/TapjoyReactNativeSdkExample/Images.xcassets/Contents.json +6 -0
  46. package/example/ios/TapjoyReactNativeSdkExample/Info.plist +59 -0
  47. package/example/ios/TapjoyReactNativeSdkExample/LaunchScreen.storyboard +46 -0
  48. package/example/ios/TapjoyReactNativeSdkExample/main.m +10 -0
  49. package/example/ios/TapjoyReactNativeSdkExample-Bridging-Header.h +3 -0
  50. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +818 -0
  51. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/xcshareddata/xcschemes/TapjoyReactNativeSdkExample.xcscheme +88 -0
  52. package/example/ios/TapjoyReactNativeSdkExample.xcworkspace/contents.xcworkspacedata +10 -0
  53. package/example/ios/TapjoyReactNativeSdkExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  54. package/example/ios/TapjoyReactNativeSdkExampleTests/Info.plist +24 -0
  55. package/example/ios/TapjoyReactNativeSdkExampleTests/TapjoyReactNativeSdkExampleTests.m +66 -0
  56. package/example/metro.config.js +40 -0
  57. package/example/package.json +32 -0
  58. package/example/react-native.config.js +10 -0
  59. package/example/src/App.tsx +27 -0
  60. package/example/src/Button.tsx +26 -0
  61. package/example/src/MainScreen.tsx +152 -0
  62. package/example/src/OfferwallScreen.tsx +172 -0
  63. package/example/src/Styles.ts +120 -0
  64. package/example/src/UserProperties.tsx +93 -0
  65. package/package.json +17 -5
  66. package/tapjoy-react-native-sdk.podspec +1 -1
  67. package/lib/typescript/package/src/TJPlacement.d.ts +0 -17
  68. package/lib/typescript/package/src/TJPlacement.d.ts.map +0 -1
  69. package/lib/typescript/package/src/TJPrivacyPolicy.d.ts +0 -8
  70. package/lib/typescript/package/src/TJPrivacyPolicy.d.ts.map +0 -1
  71. package/lib/typescript/package/src/TJVersion.d.ts +0 -5
  72. package/lib/typescript/package/src/TJVersion.d.ts.map +0 -1
  73. package/lib/typescript/package/src/index.d.ts +0 -7
  74. package/lib/typescript/package/src/index.d.ts.map +0 -1
  75. package/lib/typescript/src/TJPlacement.d.ts +0 -17
  76. package/lib/typescript/src/TJPlacement.d.ts.map +0 -1
  77. package/lib/typescript/src/TJPrivacyPolicy.d.ts +0 -8
  78. package/lib/typescript/src/TJPrivacyPolicy.d.ts.map +0 -1
  79. package/lib/typescript/src/TJVersion.d.ts +0 -5
  80. package/lib/typescript/src/TJVersion.d.ts.map +0 -1
  81. package/lib/typescript/src/index.d.ts +0 -7
  82. package/lib/typescript/src/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -21,9 +21,9 @@ brew install ios-deploy
21
21
 
22
22
  ### Install Dependency
23
23
 
24
- `yarn` command will install all dependencies including pod dependency.
24
+ `yarn bootstrap` command will install all dependencies including pod dependency.
25
25
  ```shell
26
- yarn
26
+ yarn bootstrap
27
27
  ```
28
28
  ### Running Example
29
29
 
@@ -0,0 +1,172 @@
1
+ apply plugin: "com.android.application"
2
+ apply plugin: "com.facebook.react"
3
+
4
+ import com.android.build.OutputFile
5
+
6
+ /**
7
+ * This is the configuration block to customize your React Native Android app.
8
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
9
+ */
10
+ react {
11
+ /* Folders */
12
+ // The root of your project, i.e. where "package.json" lives. Default is '..'
13
+ // root = file("../")
14
+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native
15
+ // reactNativeDir = file("../node_modules/react-native")
16
+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
17
+ // codegenDir = file("../node_modules/react-native-codegen")
18
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19
+ // cliFile = file("../node_modules/react-native/cli.js")
20
+
21
+ /* Variants */
22
+ // The list of variants to that are debuggable. For those we're going to
23
+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
24
+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
25
+ // debuggableVariants = ["liteDebug", "prodDebug"]
26
+
27
+ /* Bundling */
28
+ // A list containing the node command and its flags. Default is just 'node'.
29
+ // nodeExecutableAndArgs = ["node"]
30
+ //
31
+ // The command to run when bundling. By default is 'bundle'
32
+ // bundleCommand = "ram-bundle"
33
+ //
34
+ // The path to the CLI configuration file. Default is empty.
35
+ // bundleConfig = file(../rn-cli.config.js)
36
+ //
37
+ // The name of the generated asset file containing your JS bundle
38
+ // bundleAssetName = "MyApplication.android.bundle"
39
+ //
40
+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
41
+ // entryFile = file("../js/MyApplication.android.js")
42
+ //
43
+ // A list of extra flags to pass to the 'bundle' commands.
44
+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
45
+ // extraPackagerArgs = []
46
+
47
+ /* Hermes Commands */
48
+ // The hermes compiler command to run. By default it is 'hermesc'
49
+ // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
50
+ //
51
+ // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
52
+ // hermesFlags = ["-O", "-output-source-map"]
53
+ }
54
+
55
+ /**
56
+ * Set this to true to create four separate APKs instead of one,
57
+ * one for each native architecture. This is useful if you don't
58
+ * use App Bundles (https://developer.android.com/guide/app-bundle/)
59
+ * and want to have separate APKs to upload to the Play Store.
60
+ */
61
+ def enableSeparateBuildPerCPUArchitecture = false
62
+
63
+ /**
64
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
65
+ */
66
+ def enableProguardInReleaseBuilds = false
67
+
68
+ /**
69
+ * The preferred build flavor of JavaScriptCore (JSC)
70
+ *
71
+ * For example, to use the international variant, you can use:
72
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
73
+ *
74
+ * The international variant includes ICU i18n library and necessary data
75
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
76
+ * give correct results when using with locales other than en-US. Note that
77
+ * this variant is about 6MiB larger per architecture than default.
78
+ */
79
+ def jscFlavor = 'org.webkit:android-jsc:+'
80
+
81
+ /**
82
+ * Private function to get the list of Native Architectures you want to build.
83
+ * This reads the value from reactNativeArchitectures in your gradle.properties
84
+ * file and works together with the --active-arch-only flag of react-native run-android.
85
+ */
86
+ def reactNativeArchitectures() {
87
+ def value = project.getProperties().get("reactNativeArchitectures")
88
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
89
+ }
90
+
91
+ android {
92
+ ndkVersion rootProject.ext.ndkVersion
93
+
94
+ compileSdkVersion rootProject.ext.compileSdkVersion
95
+
96
+ namespace "com.tapjoyreactnativesdkexample"
97
+ defaultConfig {
98
+ applicationId "com.tapjoyreactnativesdkexample"
99
+ minSdkVersion rootProject.ext.minSdkVersion
100
+ targetSdkVersion rootProject.ext.targetSdkVersion
101
+ versionCode 1
102
+ versionName "1.0"
103
+ }
104
+
105
+ splits {
106
+ abi {
107
+ reset()
108
+ enable enableSeparateBuildPerCPUArchitecture
109
+ universalApk false // If true, also generate a universal APK
110
+ include (*reactNativeArchitectures())
111
+ }
112
+ }
113
+ signingConfigs {
114
+ debug {
115
+ storeFile file('debug.keystore')
116
+ storePassword 'android'
117
+ keyAlias 'androiddebugkey'
118
+ keyPassword 'android'
119
+ }
120
+ }
121
+ buildTypes {
122
+ debug {
123
+ signingConfig signingConfigs.debug
124
+ }
125
+ release {
126
+ // Caution! In production, you need to generate your own keystore file.
127
+ // see https://reactnative.dev/docs/signed-apk-android.
128
+ signingConfig signingConfigs.debug
129
+ minifyEnabled enableProguardInReleaseBuilds
130
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
131
+ }
132
+ }
133
+
134
+ // applicationVariants are e.g. debug, release
135
+ applicationVariants.all { variant ->
136
+ variant.outputs.each { output ->
137
+ // For each separate APK per architecture, set a unique version code as described here:
138
+ // https://developer.android.com/studio/build/configure-apk-splits.html
139
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
140
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
141
+ def abi = output.getFilter(OutputFile.ABI)
142
+ if (abi != null) { // null for the universal-debug, universal-release variants
143
+ output.versionCodeOverride =
144
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
145
+ }
146
+
147
+ }
148
+ }
149
+ }
150
+
151
+ dependencies {
152
+ // The version of react-native is set by the React Native Gradle Plugin
153
+ implementation("com.facebook.react:react-android")
154
+
155
+ implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
156
+
157
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
158
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
159
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
160
+ }
161
+
162
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
163
+ if (hermesEnabled.toBoolean()) {
164
+ implementation("com.facebook.react:hermes-android")
165
+ } else {
166
+ implementation jscFlavor
167
+ }
168
+
169
+ implementation 'com.tapjoy:tapjoy-android-sdk:13.0.1'
170
+ }
171
+
172
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+
5
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
+
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12
+ </application>
13
+ </manifest>
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5
+ * directory of this source tree.
6
+ */
7
+ package com.tapjoyreactnativesdkexample;
8
+
9
+ import android.content.Context;
10
+ import com.facebook.flipper.android.AndroidFlipperClient;
11
+ import com.facebook.flipper.android.utils.FlipperUtils;
12
+ import com.facebook.flipper.core.FlipperClient;
13
+ import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14
+ import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15
+ import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16
+ import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17
+ import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18
+ import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19
+ import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20
+ import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
21
+ import com.facebook.react.ReactInstanceEventListener;
22
+ import com.facebook.react.ReactInstanceManager;
23
+ import com.facebook.react.bridge.ReactContext;
24
+ import com.facebook.react.modules.network.NetworkingModule;
25
+ import okhttp3.OkHttpClient;
26
+
27
+ /**
28
+ * Class responsible of loading Flipper inside your React Native application. This is the debug
29
+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.
30
+ */
31
+ public class ReactNativeFlipper {
32
+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
33
+ if (FlipperUtils.shouldEnableFlipper(context)) {
34
+ final FlipperClient client = AndroidFlipperClient.getInstance(context);
35
+
36
+ client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
37
+ client.addPlugin(new DatabasesFlipperPlugin(context));
38
+ client.addPlugin(new SharedPreferencesFlipperPlugin(context));
39
+ client.addPlugin(CrashReporterPlugin.getInstance());
40
+
41
+ NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
42
+ NetworkingModule.setCustomClientBuilder(
43
+ new NetworkingModule.CustomClientBuilder() {
44
+ @Override
45
+ public void apply(OkHttpClient.Builder builder) {
46
+ builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
47
+ }
48
+ });
49
+ client.addPlugin(networkFlipperPlugin);
50
+ client.start();
51
+
52
+ // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
53
+ // Hence we run if after all native modules have been initialized
54
+ ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
55
+ if (reactContext == null) {
56
+ reactInstanceManager.addReactInstanceEventListener(
57
+ new ReactInstanceEventListener() {
58
+ @Override
59
+ public void onReactContextInitialized(ReactContext reactContext) {
60
+ reactInstanceManager.removeReactInstanceEventListener(this);
61
+ reactContext.runOnNativeModulesQueueThread(
62
+ new Runnable() {
63
+ @Override
64
+ public void run() {
65
+ client.addPlugin(new FrescoFlipperPlugin());
66
+ }
67
+ });
68
+ }
69
+ });
70
+ } else {
71
+ client.addPlugin(new FrescoFlipperPlugin());
72
+ }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,24 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+
5
+ <application
6
+ android:name=".MainApplication"
7
+ android:label="@string/app_name"
8
+ android:icon="@mipmap/ic_launcher"
9
+ android:allowBackup="false"
10
+ android:theme="@style/AppTheme">
11
+ <activity
12
+ android:name=".MainActivity"
13
+ android:label="@string/app_name"
14
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
15
+ android:launchMode="singleTask"
16
+ android:windowSoftInputMode="adjustResize"
17
+ android:exported="true">
18
+ <intent-filter>
19
+ <action android:name="android.intent.action.MAIN" />
20
+ <category android:name="android.intent.category.LAUNCHER" />
21
+ </intent-filter>
22
+ </activity>
23
+ </application>
24
+ </manifest>
@@ -0,0 +1,35 @@
1
+ package com.tapjoyreactnativesdkexample;
2
+
3
+ import com.facebook.react.ReactActivity;
4
+ import com.facebook.react.ReactActivityDelegate;
5
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
6
+ import com.facebook.react.defaults.DefaultReactActivityDelegate;
7
+
8
+ public class MainActivity extends ReactActivity {
9
+
10
+ /**
11
+ * Returns the name of the main component registered from JavaScript. This is used to schedule
12
+ * rendering of the component.
13
+ */
14
+ @Override
15
+ protected String getMainComponentName() {
16
+ return "TapjoyReactNativeSdkExample";
17
+ }
18
+
19
+ /**
20
+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
21
+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
22
+ * (aka React 18) with two boolean flags.
23
+ */
24
+ @Override
25
+ protected ReactActivityDelegate createReactActivityDelegate() {
26
+ return new DefaultReactActivityDelegate(
27
+ this,
28
+ getMainComponentName(),
29
+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.
30
+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
31
+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
32
+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
33
+ );
34
+ }
35
+ }
@@ -0,0 +1,62 @@
1
+ package com.tapjoyreactnativesdkexample;
2
+
3
+ import android.app.Application;
4
+ import com.facebook.react.PackageList;
5
+ import com.facebook.react.ReactApplication;
6
+ import com.facebook.react.ReactNativeHost;
7
+ import com.facebook.react.ReactPackage;
8
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
9
+ import com.facebook.react.defaults.DefaultReactNativeHost;
10
+ import com.facebook.soloader.SoLoader;
11
+ import java.util.List;
12
+
13
+ public class MainApplication extends Application implements ReactApplication {
14
+
15
+ private final ReactNativeHost mReactNativeHost =
16
+ new DefaultReactNativeHost(this) {
17
+ @Override
18
+ public boolean getUseDeveloperSupport() {
19
+ return BuildConfig.DEBUG;
20
+ }
21
+
22
+ @Override
23
+ protected List<ReactPackage> getPackages() {
24
+ @SuppressWarnings("UnnecessaryLocalVariable")
25
+ List<ReactPackage> packages = new PackageList(this).getPackages();
26
+ // Packages that cannot be autolinked yet can be added manually here, for example:
27
+ // packages.add(new MyReactNativePackage());
28
+ return packages;
29
+ }
30
+
31
+ @Override
32
+ protected String getJSMainModuleName() {
33
+ return "index";
34
+ }
35
+
36
+ @Override
37
+ protected boolean isNewArchEnabled() {
38
+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
39
+ }
40
+
41
+ @Override
42
+ protected Boolean isHermesEnabled() {
43
+ return BuildConfig.IS_HERMES_ENABLED;
44
+ }
45
+ };
46
+
47
+ @Override
48
+ public ReactNativeHost getReactNativeHost() {
49
+ return mReactNativeHost;
50
+ }
51
+
52
+ @Override
53
+ public void onCreate() {
54
+ super.onCreate();
55
+ SoLoader.init(this, /* native exopackage */ false);
56
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
57
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
58
+ DefaultNewArchitectureEntryPoint.load();
59
+ }
60
+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
61
+ }
62
+ }
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Copyright (C) 2014 The Android Open Source Project
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+ <inset xmlns:android="http://schemas.android.com/apk/res/android"
17
+ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18
+ android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19
+ android:insetTop="@dimen/abc_edit_text_inset_top_material"
20
+ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
21
+
22
+ <selector>
23
+ <!--
24
+ This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
25
+ The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
26
+ NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
27
+
28
+ <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
29
+
30
+ For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
31
+ -->
32
+ <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
33
+ <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
34
+ </selector>
35
+
36
+ </inset>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name">Tapjoy RN</string>
3
+ </resources>
@@ -0,0 +1,11 @@
1
+ <resources>
2
+
3
+ <!-- Base application theme. -->
4
+ <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
5
+ <!-- Customize your theme here. -->
6
+ <item name="android:forceDarkAllowed">false</item>
7
+ <item name="android:textColor">#000000</item>
8
+ <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
9
+ </style>
10
+
11
+ </resources>
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5
+ * directory of this source tree.
6
+ */
7
+ package com.tapjoyreactnativesdkexample;
8
+
9
+ import android.content.Context;
10
+ import com.facebook.react.ReactInstanceManager;
11
+
12
+ /**
13
+ * Class responsible of loading Flipper inside your React Native application. This is the release
14
+ * flavor of it so it's empty as we don't want to load Flipper.
15
+ */
16
+ public class ReactNativeFlipper {
17
+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
18
+ // Do nothing as we don't want to initialize Flipper on Release.
19
+ }
20
+ }
@@ -0,0 +1,30 @@
1
+ // Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+
3
+ buildscript {
4
+ ext {
5
+ buildToolsVersion = "33.0.0"
6
+ minSdkVersion = 21
7
+ compileSdkVersion = 33
8
+ targetSdkVersion = 33
9
+
10
+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
11
+ ndkVersion = "23.1.7779620"
12
+ }
13
+ repositories {
14
+ google()
15
+ mavenCentral()
16
+ }
17
+ dependencies {
18
+ classpath("com.android.tools.build:gradle:7.3.1")
19
+ classpath("com.facebook.react:react-native-gradle-plugin")
20
+ }
21
+ }
22
+
23
+ allprojects {
24
+ repositories {
25
+ maven {
26
+ name "Tapjoy's maven repo"
27
+ url "https://sdk.tapjoy.com/"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,5 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4
+ zipStoreBase=GRADLE_USER_HOME
5
+ zipStorePath=wrapper/dists
@@ -0,0 +1,44 @@
1
+ # Project-wide Gradle settings.
2
+
3
+ # IDE (e.g. Android Studio) users:
4
+ # Gradle settings configured through the IDE *will override*
5
+ # any settings specified in this file.
6
+
7
+ # For more details on how to configure your build environment visit
8
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+ # Specifies the JVM arguments used for the daemon process.
11
+ # The setting is particularly useful for tweaking memory settings.
12
+ # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13
+ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14
+
15
+ # When configured, Gradle will run in incubating parallel mode.
16
+ # This option should only be used with decoupled projects. More details, visit
17
+ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ # org.gradle.parallel=true
19
+
20
+ # AndroidX package structure to make it clearer which packages are bundled with the
21
+ # Android operating system, and which are packaged with your app's APK
22
+ # https://developer.android.com/topic/libraries/support-library/androidx-rn
23
+ android.useAndroidX=true
24
+ # Automatically convert third-party libraries to use AndroidX
25
+ android.enableJetifier=true
26
+
27
+ # Version of flipper SDK to use with React Native
28
+ FLIPPER_VERSION=0.125.0
29
+
30
+ # Use this property to specify which architecture you want to build.
31
+ # You can also override it from the CLI using
32
+ # ./gradlew <task> -PreactNativeArchitectures=x86_64
33
+ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
34
+
35
+ # Use this property to enable support to the new architecture.
36
+ # This will allow you to use TurboModules and the Fabric render in
37
+ # your application. You should enable this flag either if you want
38
+ # to write custom TurboModules/Fabric components OR use libraries that
39
+ # are providing them.
40
+ newArchEnabled=false
41
+
42
+ # Use this property to enable or disable the Hermes JS engine.
43
+ # If set to false, you will be using JSC instead.
44
+ hermesEnabled=true