tapjoy-react-native-sdk 13.3.0 → 13.4.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.
- package/android/build.gradle +5 -5
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +72 -2
- package/example/Gemfile +7 -0
- package/example/android/app/build.gradle +10 -61
- package/example/android/app/src/debug/AndroidManifest.xml +1 -5
- package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainActivity.kt +22 -0
- package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.kt +45 -0
- package/example/android/build.gradle +9 -9
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +4 -2
- package/example/android/gradle.properties +0 -3
- package/example/android/gradlew +24 -9
- package/example/babel.config.js +1 -1
- package/example/ios/Podfile +0 -9
- package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.mm +6 -11
- package/example/ios/TapjoyReactNativeSdkExample/Info.plist +9 -13
- package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +18 -8
- package/example/package.json +21 -18
- package/example/src/MainScreen.tsx +25 -6
- package/example/src/Styles.ts +8 -0
- package/example/src/UserProperties.tsx +43 -0
- package/ios/TapjoyReactNativeSdk.m +5 -0
- package/ios/TapjoyReactNativeSdk.swift +65 -1
- package/package.json +22 -23
- package/src/TJConnect.ts +5 -0
- package/src/TJVersion.ts +1 -1
- package/src/index.ts +11 -1
- package/tapjoy-react-native-sdk.podspec +1 -1
- package/example/android/app/src/debug/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +0 -75
- package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainActivity.java +0 -35
- package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.java +0 -62
- package/example/android/app/src/release/java/com/tapjoyreactnativesdkexample/ReactNativeFlipper.java +0 -20
- package/lib/commonjs/TJEntryPoint.js +0 -22
- package/lib/commonjs/TJEntryPoint.js.map +0 -1
- package/lib/commonjs/TJOfferwallDiscoverView.js +0 -37
- package/lib/commonjs/TJOfferwallDiscoverView.js.map +0 -1
- package/lib/commonjs/TJPlacement.js +0 -149
- package/lib/commonjs/TJPlacement.js.map +0 -1
- package/lib/commonjs/TJPrivacyPolicy.js +0 -77
- package/lib/commonjs/TJPrivacyPolicy.js.map +0 -1
- package/lib/commonjs/TJSegment.js +0 -16
- package/lib/commonjs/TJSegment.js.map +0 -1
- package/lib/commonjs/TJStatus.js +0 -15
- package/lib/commonjs/TJStatus.js.map +0 -1
- package/lib/commonjs/TJUtil.js +0 -21
- package/lib/commonjs/TJUtil.js.map +0 -1
- package/lib/commonjs/TJVersion.js +0 -22
- package/lib/commonjs/TJVersion.js.map +0 -1
- package/lib/commonjs/index.js +0 -63
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/TJEntryPoint.js +0 -15
- package/lib/module/TJEntryPoint.js.map +0 -1
- package/lib/module/TJOfferwallDiscoverView.js +0 -29
- package/lib/module/TJOfferwallDiscoverView.js.map +0 -1
- package/lib/module/TJPlacement.js +0 -141
- package/lib/module/TJPlacement.js.map +0 -1
- package/lib/module/TJPrivacyPolicy.js +0 -70
- package/lib/module/TJPrivacyPolicy.js.map +0 -1
- package/lib/module/TJSegment.js +0 -9
- package/lib/module/TJSegment.js.map +0 -1
- package/lib/module/TJStatus.js +0 -8
- package/lib/module/TJStatus.js.map +0 -1
- package/lib/module/TJUtil.js +0 -14
- package/lib/module/TJUtil.js.map +0 -1
- package/lib/module/TJVersion.js +0 -14
- package/lib/module/TJVersion.js.map +0 -1
- package/lib/module/index.js +0 -19
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/TJEntryPoint.d.ts +0 -14
- package/lib/typescript/TJEntryPoint.d.ts.map +0 -1
- package/lib/typescript/TJOfferwallDiscoverView.d.ts +0 -18
- package/lib/typescript/TJOfferwallDiscoverView.d.ts.map +0 -1
- package/lib/typescript/TJPlacement.d.ts +0 -76
- package/lib/typescript/TJPlacement.d.ts.map +0 -1
- package/lib/typescript/TJPrivacyPolicy.d.ts +0 -17
- package/lib/typescript/TJPrivacyPolicy.d.ts.map +0 -1
- package/lib/typescript/TJSegment.d.ts +0 -8
- package/lib/typescript/TJSegment.d.ts.map +0 -1
- package/lib/typescript/TJStatus.d.ts +0 -7
- package/lib/typescript/TJStatus.d.ts.map +0 -1
- package/lib/typescript/TJUtil.d.ts +0 -5
- package/lib/typescript/TJUtil.d.ts.map +0 -1
- package/lib/typescript/TJVersion.d.ts +0 -5
- package/lib/typescript/TJVersion.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -10
- package/lib/typescript/index.d.ts.map +0 -1
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,7 @@ buildscript {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
dependencies {
|
|
11
|
-
classpath "com.android.tools.build:gradle:
|
|
11
|
+
classpath "com.android.tools.build:gradle:8.1.2"
|
|
12
12
|
// noinspection DifferentKotlinGradleVersion
|
|
13
13
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
14
|
classpath "com.facebook.react:react-native-gradle-plugin"
|
|
@@ -58,8 +58,8 @@ android {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
compileOptions {
|
|
61
|
-
sourceCompatibility JavaVersion.
|
|
62
|
-
targetCompatibility JavaVersion.
|
|
61
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
62
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
}
|
|
@@ -79,9 +79,9 @@ dependencies {
|
|
|
79
79
|
// For < 0.71, this will be from the local maven repo
|
|
80
80
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
81
81
|
//noinspection GradleDynamicVersion
|
|
82
|
-
implementation 'com.facebook.react:react-native:0.
|
|
82
|
+
implementation 'com.facebook.react:react-native:0.73.2'
|
|
83
83
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
84
|
-
implementation 'com.tapjoy:tapjoy-android-sdk:13.
|
|
84
|
+
implementation 'com.tapjoy:tapjoy-android-sdk:13.4.1'
|
|
85
85
|
implementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
TapjoyReactNativeSdk_kotlinVersion=1.
|
|
1
|
+
TapjoyReactNativeSdk_kotlinVersion=1.8.0
|
|
2
2
|
TapjoyReactNativeSdk_minSdkVersion=21
|
|
3
|
-
TapjoyReactNativeSdk_targetSdkVersion=
|
|
4
|
-
TapjoyReactNativeSdk_compileSdkVersion=
|
|
5
|
-
TapjoyReactNativeSdk_ndkversion=
|
|
6
|
-
android.useAndroidX=true
|
|
3
|
+
TapjoyReactNativeSdk_targetSdkVersion=34
|
|
4
|
+
TapjoyReactNativeSdk_compileSdkVersion=34
|
|
5
|
+
TapjoyReactNativeSdk_ndkversion=25.1.8937393
|
|
6
|
+
android.useAndroidX=true
|
|
@@ -7,7 +7,6 @@ import com.tapjoy.TJSpendCurrencyListener
|
|
|
7
7
|
import com.tapjoy.TJAwardCurrencyListener
|
|
8
8
|
import com.tapjoy.TJSetUserIDListener
|
|
9
9
|
import com.tapjoy.Tapjoy
|
|
10
|
-
import com.tapjoy.TapjoyConnectCore
|
|
11
10
|
import com.tapjoy.TJError;
|
|
12
11
|
import com.tapjoy.TJPlacement;
|
|
13
12
|
import com.tapjoy.TJActionRequest;
|
|
@@ -17,6 +16,7 @@ import com.tapjoy.TJSetCurrencyAmountRequiredListener;
|
|
|
17
16
|
import com.tapjoy.TJStatus;
|
|
18
17
|
import com.tapjoy.TJPrivacyPolicy;
|
|
19
18
|
import com.tapjoy.TJSegment;
|
|
19
|
+
import com.tapjoy.TapjoyPluginAPI;
|
|
20
20
|
import com.tapjoy.TJEntryPoint
|
|
21
21
|
import java.util.Hashtable
|
|
22
22
|
import kotlin.collections.HashMap
|
|
@@ -70,7 +70,7 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
70
70
|
*/
|
|
71
71
|
@ReactMethod
|
|
72
72
|
fun connect(sdkKey: String, connectFlags: ReadableMap, promise: Promise) {
|
|
73
|
-
|
|
73
|
+
TapjoyPluginAPI.setPlugin("ReactNative");
|
|
74
74
|
|
|
75
75
|
Tapjoy.connect(this.currentActivity?.applicationContext, sdkKey, connectFlags.toHashtable(), object : TJConnectListener() {
|
|
76
76
|
override fun onConnectSuccess() {
|
|
@@ -81,6 +81,15 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
81
81
|
override fun onConnectFailure(code: Int, message: String) {
|
|
82
82
|
promise.reject(code.toString(), message, Exception(message))
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
override fun onConnectWarning(code: Int, message: String) {
|
|
86
|
+
val parameters = Arguments.createMap().apply {
|
|
87
|
+
putString("name", "onConnectWarning")
|
|
88
|
+
putString("code", code.toString())
|
|
89
|
+
putString("message", message)
|
|
90
|
+
}
|
|
91
|
+
sendEvent("Tapjoy", parameters)
|
|
92
|
+
}
|
|
84
93
|
})
|
|
85
94
|
}
|
|
86
95
|
|
|
@@ -187,6 +196,67 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
187
196
|
Tapjoy.setMaxLevel(maxLevel);
|
|
188
197
|
}
|
|
189
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Returns a String set which contains tags on the user.
|
|
201
|
+
*
|
|
202
|
+
* @return list of user tags
|
|
203
|
+
*/
|
|
204
|
+
@ReactMethod
|
|
205
|
+
fun getUserTags(promise: Promise) {
|
|
206
|
+
val tags = Tapjoy.getUserTags()
|
|
207
|
+
val tagsArray: WritableArray = Arguments.createArray()
|
|
208
|
+
|
|
209
|
+
tags.forEach { tag ->
|
|
210
|
+
tagsArray.pushString(tag.toString())
|
|
211
|
+
}
|
|
212
|
+
promise.resolve(tagsArray)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Sets tags for the user.
|
|
217
|
+
*
|
|
218
|
+
* @param tags
|
|
219
|
+
* the tags to be set
|
|
220
|
+
*/
|
|
221
|
+
@ReactMethod
|
|
222
|
+
fun setUserTags(tags: ReadableArray) {
|
|
223
|
+
val tagsSet: Set<String> = (0 until tags.size())
|
|
224
|
+
.mapNotNull { tags.getString(it) }
|
|
225
|
+
.toSet()
|
|
226
|
+
Tapjoy.setUserTags(tagsSet)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Removes all tags from the user.
|
|
231
|
+
*/
|
|
232
|
+
@ReactMethod
|
|
233
|
+
fun clearUserTags() {
|
|
234
|
+
Tapjoy.clearUserTags()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Adds the given tag to the user if it is not already present.
|
|
239
|
+
*
|
|
240
|
+
* @param tag
|
|
241
|
+
* the tag to be added
|
|
242
|
+
*/
|
|
243
|
+
@ReactMethod
|
|
244
|
+
fun addUserTag(tag: String) {
|
|
245
|
+
Tapjoy.addUserTag(tag)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Removes the given tag from the user if it is present.
|
|
250
|
+
*
|
|
251
|
+
* @param tag
|
|
252
|
+
* the tag to be removed
|
|
253
|
+
*/
|
|
254
|
+
@ReactMethod
|
|
255
|
+
fun removeUserTag(tag: String) {
|
|
256
|
+
Tapjoy.removeUserTag(tag)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
190
260
|
@ReactMethod
|
|
191
261
|
fun setDebugEnabled(enabled: Boolean) {
|
|
192
262
|
Tapjoy.setDebugEnabled(enabled)
|
package/example/Gemfile
ADDED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
apply plugin: "com.android.application"
|
|
2
2
|
apply plugin: "com.facebook.react"
|
|
3
|
-
|
|
4
|
-
import com.android.build.OutputFile
|
|
3
|
+
apply plugin: "org.jetbrains.kotlin.android"
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* This is the configuration block to customize your React Native Android app.
|
|
@@ -13,8 +12,8 @@ react {
|
|
|
13
12
|
// root = file("../")
|
|
14
13
|
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
15
14
|
// reactNativeDir = file("../node_modules/react-native")
|
|
16
|
-
// The folder where the react-native Codegen package is. Default is ../node_modules
|
|
17
|
-
// codegenDir = file("../node_modules
|
|
15
|
+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
|
|
16
|
+
// codegenDir = file("../node_modules/@react-native/codegen")
|
|
18
17
|
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
19
18
|
// cliFile = file("../node_modules/react-native/cli.js")
|
|
20
19
|
|
|
@@ -52,14 +51,6 @@ react {
|
|
|
52
51
|
// hermesFlags = ["-O", "-output-source-map"]
|
|
53
52
|
}
|
|
54
53
|
|
|
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
54
|
/**
|
|
64
55
|
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
65
56
|
*/
|
|
@@ -78,20 +69,10 @@ def enableProguardInReleaseBuilds = false
|
|
|
78
69
|
*/
|
|
79
70
|
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
80
71
|
|
|
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
72
|
android {
|
|
92
73
|
ndkVersion rootProject.ext.ndkVersion
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
75
|
+
compileSdk rootProject.ext.compileSdkVersion
|
|
95
76
|
|
|
96
77
|
namespace "com.tapjoyreactnativesdkexample"
|
|
97
78
|
defaultConfig {
|
|
@@ -101,15 +82,6 @@ android {
|
|
|
101
82
|
versionCode 1
|
|
102
83
|
versionName "1.0"
|
|
103
84
|
}
|
|
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
85
|
signingConfigs {
|
|
114
86
|
debug {
|
|
115
87
|
storeFile file('debug.keystore')
|
|
@@ -130,36 +102,13 @@ android {
|
|
|
130
102
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
131
103
|
}
|
|
132
104
|
}
|
|
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
105
|
}
|
|
150
106
|
|
|
151
107
|
dependencies {
|
|
152
108
|
// 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")
|
|
109
|
+
implementation("com.facebook.react:react-android:")
|
|
110
|
+
implementation("com.facebook.react:flipper-integration")
|
|
156
111
|
|
|
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
112
|
if (hermesEnabled.toBoolean()) {
|
|
164
113
|
implementation("com.facebook.react:hermes-android")
|
|
165
114
|
} else {
|
|
@@ -167,8 +116,8 @@ dependencies {
|
|
|
167
116
|
}
|
|
168
117
|
|
|
169
118
|
implementation 'com.google.android.gms:play-services-appset:16.0.2'
|
|
170
|
-
implementation 'com.tapjoy:tapjoy-android-sdk:13.
|
|
171
|
-
|
|
119
|
+
implementation 'com.tapjoy:tapjoy-android-sdk:13.4.1'
|
|
120
|
+
|
|
172
121
|
}
|
|
173
122
|
|
|
174
|
-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
123
|
+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
3
|
xmlns:tools="http://schemas.android.com/tools">
|
|
4
4
|
|
|
5
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
-
|
|
7
5
|
<application
|
|
8
6
|
android:usesCleartextTraffic="true"
|
|
9
7
|
tools:targetApi="28"
|
|
10
|
-
tools:ignore="GoogleAppIndexingWarning"
|
|
11
|
-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
|
|
12
|
-
</application>
|
|
8
|
+
tools:ignore="GoogleAppIndexingWarning"/>
|
|
13
9
|
</manifest>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.tapjoyreactnativesdkexample
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactActivity
|
|
4
|
+
import com.facebook.react.ReactActivityDelegate
|
|
5
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
6
|
+
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
7
|
+
|
|
8
|
+
class MainActivity : 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 fun getMainComponentName(): String = "TapjoyReactNativeSdkExample"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
18
|
+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
19
|
+
*/
|
|
20
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
21
|
+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
22
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.ReactHost
|
|
7
|
+
import com.facebook.react.ReactNativeHost
|
|
8
|
+
import com.facebook.react.ReactPackage
|
|
9
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
10
|
+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
11
|
+
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
12
|
+
import com.facebook.react.flipper.ReactNativeFlipper
|
|
13
|
+
import com.facebook.soloader.SoLoader
|
|
14
|
+
|
|
15
|
+
class MainApplication : Application(), ReactApplication {
|
|
16
|
+
|
|
17
|
+
override val reactNativeHost: ReactNativeHost =
|
|
18
|
+
object : DefaultReactNativeHost(this) {
|
|
19
|
+
override fun getPackages(): List<ReactPackage> =
|
|
20
|
+
PackageList(this).packages.apply {
|
|
21
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
22
|
+
// add(MyReactNativePackage())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun getJSMainModuleName(): String = "index"
|
|
26
|
+
|
|
27
|
+
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
28
|
+
|
|
29
|
+
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
30
|
+
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
override val reactHost: ReactHost
|
|
34
|
+
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
|
|
35
|
+
|
|
36
|
+
override fun onCreate() {
|
|
37
|
+
super.onCreate()
|
|
38
|
+
SoLoader.init(this, false)
|
|
39
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
40
|
+
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
41
|
+
load()
|
|
42
|
+
}
|
|
43
|
+
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
2
|
-
|
|
3
1
|
buildscript {
|
|
4
2
|
ext {
|
|
5
|
-
buildToolsVersion = "
|
|
3
|
+
buildToolsVersion = "34.0.0"
|
|
6
4
|
minSdkVersion = 21
|
|
7
|
-
compileSdkVersion =
|
|
8
|
-
targetSdkVersion =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ndkVersion = "23.1.7779620"
|
|
5
|
+
compileSdkVersion = 34
|
|
6
|
+
targetSdkVersion = 34
|
|
7
|
+
ndkVersion = "25.1.8937393"
|
|
8
|
+
kotlinVersion = "1.8.0"
|
|
12
9
|
}
|
|
13
10
|
repositories {
|
|
14
11
|
google()
|
|
15
12
|
mavenCentral()
|
|
16
13
|
}
|
|
17
14
|
dependencies {
|
|
18
|
-
classpath("com.android.tools.build:gradle
|
|
15
|
+
classpath("com.android.tools.build:gradle")
|
|
19
16
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
17
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
apply plugin: "com.facebook.react.rootproject"
|
|
22
|
+
|
|
23
23
|
allprojects {
|
|
24
24
|
repositories {
|
|
25
25
|
maven {
|
|
Binary file
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
|
4
|
+
networkTimeout=10000
|
|
5
|
+
validateDistributionUrl=true
|
|
4
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
|
-
zipStorePath=wrapper/dists
|
|
7
|
+
zipStorePath=wrapper/dists
|
|
@@ -24,9 +24,6 @@ android.useAndroidX=true
|
|
|
24
24
|
# Automatically convert third-party libraries to use AndroidX
|
|
25
25
|
android.enableJetifier=true
|
|
26
26
|
|
|
27
|
-
# Version of flipper SDK to use with React Native
|
|
28
|
-
FLIPPER_VERSION=0.125.0
|
|
29
|
-
|
|
30
27
|
# Use this property to specify which architecture you want to build.
|
|
31
28
|
# You can also override it from the CLI using
|
|
32
29
|
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
package/example/android/gradlew
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
# Darwin, MinGW, and NonStop.
|
|
56
56
|
#
|
|
57
57
|
# (3) This script is generated from the Groovy template
|
|
58
|
-
# https://github.com/gradle/gradle/blob/
|
|
58
|
+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
59
59
|
# within the Gradle project.
|
|
60
60
|
#
|
|
61
61
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
@@ -80,13 +80,11 @@ do
|
|
|
80
80
|
esac
|
|
81
81
|
done
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
APP_NAME="Gradle"
|
|
83
|
+
# This is normally unused
|
|
84
|
+
# shellcheck disable=SC2034
|
|
86
85
|
APP_BASE_NAME=${0##*/}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
86
|
+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
87
|
+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
|
90
88
|
|
|
91
89
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
92
90
|
MAX_FD=maximum
|
|
@@ -133,22 +131,29 @@ location of your Java installation."
|
|
|
133
131
|
fi
|
|
134
132
|
else
|
|
135
133
|
JAVACMD=java
|
|
136
|
-
|
|
134
|
+
if ! command -v java >/dev/null 2>&1
|
|
135
|
+
then
|
|
136
|
+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
137
137
|
|
|
138
138
|
Please set the JAVA_HOME variable in your environment to match the
|
|
139
139
|
location of your Java installation."
|
|
140
|
+
fi
|
|
140
141
|
fi
|
|
141
142
|
|
|
142
143
|
# Increase the maximum file descriptors if we can.
|
|
143
144
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
144
145
|
case $MAX_FD in #(
|
|
145
146
|
max*)
|
|
147
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
148
|
+
# shellcheck disable=SC3045
|
|
146
149
|
MAX_FD=$( ulimit -H -n ) ||
|
|
147
150
|
warn "Could not query maximum file descriptor limit"
|
|
148
151
|
esac
|
|
149
152
|
case $MAX_FD in #(
|
|
150
153
|
'' | soft) :;; #(
|
|
151
154
|
*)
|
|
155
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
156
|
+
# shellcheck disable=SC3045
|
|
152
157
|
ulimit -n "$MAX_FD" ||
|
|
153
158
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
154
159
|
esac
|
|
@@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
|
|
|
193
198
|
done
|
|
194
199
|
fi
|
|
195
200
|
|
|
201
|
+
|
|
202
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
203
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
204
|
+
|
|
196
205
|
# Collect all arguments for the java command;
|
|
197
206
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
|
198
207
|
# shell script including quotes and variable substitutions, so put them in
|
|
@@ -205,6 +214,12 @@ set -- \
|
|
|
205
214
|
org.gradle.wrapper.GradleWrapperMain \
|
|
206
215
|
"$@"
|
|
207
216
|
|
|
217
|
+
# Stop when "xargs" is not available.
|
|
218
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
219
|
+
then
|
|
220
|
+
die "xargs is not available"
|
|
221
|
+
fi
|
|
222
|
+
|
|
208
223
|
# Use "xargs" to parse quoted args.
|
|
209
224
|
#
|
|
210
225
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
@@ -231,4 +246,4 @@ eval "set -- $(
|
|
|
231
246
|
tr '\n' ' '
|
|
232
247
|
)" '"$@"'
|
|
233
248
|
|
|
234
|
-
exec "$JAVACMD" "$@"
|
|
249
|
+
exec "$JAVACMD" "$@"
|
package/example/babel.config.js
CHANGED
package/example/ios/Podfile
CHANGED
|
@@ -25,16 +25,8 @@ end
|
|
|
25
25
|
target 'TapjoyReactNativeSdkExample' do
|
|
26
26
|
config = use_native_modules!
|
|
27
27
|
|
|
28
|
-
# Flags change depending on the env values.
|
|
29
|
-
flags = get_default_flags()
|
|
30
|
-
|
|
31
28
|
use_react_native!(
|
|
32
29
|
:path => config[:reactNativePath],
|
|
33
|
-
# Hermes is now enabled by default. Disable by setting this flag to false.
|
|
34
|
-
# Upcoming versions of React Native may rely on get_default_flags(), but
|
|
35
|
-
# we make it explicit here to aid in the React Native upgrade process.
|
|
36
|
-
:hermes_enabled => flags[:hermes_enabled],
|
|
37
|
-
:fabric_enabled => flags[:fabric_enabled],
|
|
38
30
|
# Enables Flipper.
|
|
39
31
|
#
|
|
40
32
|
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
@@ -56,6 +48,5 @@ target 'TapjoyReactNativeSdkExample' do
|
|
|
56
48
|
# necessary for Mac Catalyst builds
|
|
57
49
|
:mac_catalyst_enabled => false
|
|
58
50
|
)
|
|
59
|
-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
60
51
|
end
|
|
61
52
|
end
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
18
|
+
{
|
|
19
|
+
return [self getBundleURL];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (NSURL *)getBundleURL
|
|
18
23
|
{
|
|
19
24
|
#if DEBUG
|
|
20
25
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
@@ -23,14 +28,4 @@
|
|
|
23
28
|
#endif
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
///
|
|
28
|
-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
29
|
-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
30
|
-
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
|
|
31
|
-
- (BOOL)concurrentRootEnabled
|
|
32
|
-
{
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@end
|
|
31
|
+
@end
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<key>CFBundleDevelopmentRegion</key>
|
|
6
6
|
<string>en</string>
|
|
7
7
|
<key>CFBundleDisplayName</key>
|
|
8
|
-
<string>Tapjoy
|
|
8
|
+
<string>Tapjoy RN</string>
|
|
9
9
|
<key>CFBundleExecutable</key>
|
|
10
10
|
<string>$(EXECUTABLE_NAME)</string>
|
|
11
11
|
<key>CFBundleIdentifier</key>
|
|
@@ -26,17 +26,15 @@
|
|
|
26
26
|
<true/>
|
|
27
27
|
<key>NSAppTransportSecurity</key>
|
|
28
28
|
<dict>
|
|
29
|
-
<key>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
|
34
|
-
<true/>
|
|
35
|
-
</dict>
|
|
36
|
-
</dict>
|
|
29
|
+
<key>NSAllowsArbitraryLoads</key>
|
|
30
|
+
<false/>
|
|
31
|
+
<key>NSAllowsLocalNetworking</key>
|
|
32
|
+
<true/>
|
|
37
33
|
</dict>
|
|
38
34
|
<key>NSLocationWhenInUseUsageDescription</key>
|
|
39
35
|
<string></string>
|
|
36
|
+
<key>NSUserTrackingUsageDescription</key>
|
|
37
|
+
<string>This allows us to deliver personalized ads for you.</string>
|
|
40
38
|
<key>UILaunchStoryboardName</key>
|
|
41
39
|
<string>LaunchScreen</string>
|
|
42
40
|
<key>UIRequiredDeviceCapabilities</key>
|
|
@@ -49,11 +47,9 @@
|
|
|
49
47
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
50
48
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
51
49
|
</array>
|
|
52
|
-
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
53
|
-
<true/>
|
|
54
|
-
<key>NSUserTrackingUsageDescription</key>
|
|
55
|
-
<string>This allows us to deliver personalized ads for you.</string>
|
|
56
50
|
<key>UIUserInterfaceStyle</key>
|
|
57
51
|
<string>Light</string>
|
|
52
|
+
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
53
|
+
<true/>
|
|
58
54
|
</dict>
|
|
59
55
|
</plist>
|