tapjoy-react-native-sdk 14.3.0 → 14.4.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 +1 -1
- package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +39 -0
- package/example/Gemfile +9 -1
- package/example/android/app/build.gradle +3 -3
- package/example/android/build.gradle +3 -3
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradlew +2 -3
- package/example/babel.config.js +0 -9
- package/example/ios/AppDelegate.swift +55 -0
- package/example/ios/Podfile +0 -1
- package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +5 -17
- package/example/metro.config.js +1 -1
- package/example/package.json +15 -15
- package/example/src/MainScreen.tsx +39 -5
- package/ios/TapjoyReactNativeSdk.m +4 -1
- package/ios/TapjoyReactNativeSdk.swift +14 -6
- package/lib/commonjs/TJLoggingLevel.js +8 -0
- package/lib/commonjs/TJVersion.js +1 -1
- package/lib/commonjs/Tapjoy.js +41 -1
- package/lib/commonjs/TapjoyEvent.js +1 -1
- package/lib/commonjs/index.js +2 -1
- package/lib/typescript/TJLoggingLevel.d.ts +7 -0
- package/lib/typescript/Tapjoy.d.ts +31 -0
- package/lib/typescript/TapjoyEvent.d.ts +1 -1
- package/lib/typescript/index.d.ts +4 -1
- package/package.json +4 -4
- package/src/TJLoggingLevel.ts +8 -0
- package/src/TJStatus.ts +1 -1
- package/src/TJVersion.ts +1 -1
- package/src/Tapjoy.ts +46 -3
- package/src/TapjoyEvent.ts +2 -2
- package/src/index.ts +4 -0
- package/tapjoy-react-native-sdk.podspec +1 -1
- package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.h +0 -6
- package/example/ios/TapjoyReactNativeSdkExample/AppDelegate.mm +0 -31
- package/example/ios/TapjoyReactNativeSdkExample/main.m +0 -10
- package/example/ios/TapjoyReactNativeSdkExampleTests/Info.plist +0 -24
- package/example/ios/TapjoyReactNativeSdkExampleTests/TapjoyReactNativeSdkExampleTests.m +0 -66
- package/example/package-lock.json +0 -8605
package/android/build.gradle
CHANGED
|
@@ -81,7 +81,7 @@ dependencies {
|
|
|
81
81
|
//noinspection GradleDynamicVersion
|
|
82
82
|
implementation 'com.facebook.react:react-native:0.74.1'
|
|
83
83
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
84
|
-
implementation 'com.tapjoy:tapjoy-android-sdk:14.
|
|
84
|
+
implementation 'com.tapjoy:tapjoy-android-sdk:14.4.0'
|
|
85
85
|
implementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -18,6 +18,7 @@ import com.tapjoy.TJPrivacyPolicy;
|
|
|
18
18
|
import com.tapjoy.TJSegment;
|
|
19
19
|
import com.tapjoy.TapjoyPluginAPI;
|
|
20
20
|
import com.tapjoy.TJEntryPoint
|
|
21
|
+
import com.tapjoy.TJLogLevel
|
|
21
22
|
import java.util.Hashtable
|
|
22
23
|
import kotlin.collections.HashMap
|
|
23
24
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
@@ -189,6 +190,25 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Assign a custom parameter associated with any following placement requests that contains an ad type. We will return this value on the currency callback.
|
|
195
|
+
* Only applicable for publishers who manage their own currency servers. This value does NOT get unset with each subsequent placement request.
|
|
196
|
+
* @param customParameter
|
|
197
|
+
* The custom parameter to assign to this device
|
|
198
|
+
*/
|
|
199
|
+
@ReactMethod
|
|
200
|
+
fun setCustomParameter(customParameter: String) {
|
|
201
|
+
Tapjoy.setCustomParameter(customParameter)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Returns the currently set custom parameter.
|
|
206
|
+
* @return the value of the currently set custom parameter.
|
|
207
|
+
*/
|
|
208
|
+
@ReactMethod
|
|
209
|
+
fun getCustomParameter(promise: Promise) {
|
|
210
|
+
promise.resolve(Tapjoy.getCustomParameter())
|
|
211
|
+
}
|
|
192
212
|
/**
|
|
193
213
|
* Sets the segment of the user
|
|
194
214
|
*
|
|
@@ -302,6 +322,25 @@ class TapjoyReactNativeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
302
322
|
Tapjoy.removeUserTag(tag)
|
|
303
323
|
}
|
|
304
324
|
|
|
325
|
+
@ReactMethod
|
|
326
|
+
fun setLoggingLevel(level: Int) {
|
|
327
|
+
when (level) {
|
|
328
|
+
0 -> Tapjoy.setLoggingLevel(TJLogLevel.ERROR)
|
|
329
|
+
1 -> Tapjoy.setLoggingLevel(TJLogLevel.WARNING)
|
|
330
|
+
2 -> Tapjoy.setLoggingLevel(TJLogLevel.INFO)
|
|
331
|
+
3 -> Tapjoy.setLoggingLevel(TJLogLevel.DEBUG)
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@ReactMethod
|
|
336
|
+
fun getLoggingLevel(promise: Promise) {
|
|
337
|
+
when (Tapjoy.getLoggingLevel()) {
|
|
338
|
+
TJLogLevel.ERROR -> promise.resolve(0)
|
|
339
|
+
TJLogLevel.WARNING -> promise.resolve(1)
|
|
340
|
+
TJLogLevel.INFO -> promise.resolve(2)
|
|
341
|
+
TJLogLevel.DEBUG -> promise.resolve(3)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
305
344
|
|
|
306
345
|
@ReactMethod
|
|
307
346
|
fun setDebugEnabled(enabled: Boolean) {
|
package/example/Gemfile
CHANGED
|
@@ -6,4 +6,12 @@ ruby ">= 2.6.10"
|
|
|
6
6
|
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
|
|
7
7
|
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
|
|
8
8
|
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
|
|
9
|
-
gem 'xcodeproj', '< 1.26.0'
|
|
9
|
+
gem 'xcodeproj', '< 1.26.0'
|
|
10
|
+
|
|
11
|
+
gem 'concurrent-ruby', '< 1.3.4'
|
|
12
|
+
|
|
13
|
+
# Ruby 3.4.0 has removed some libraries from the standard library.
|
|
14
|
+
gem 'bigdecimal'
|
|
15
|
+
gem 'logger'
|
|
16
|
+
gem 'benchmark'
|
|
17
|
+
gem 'mutex_m'
|
|
@@ -62,14 +62,14 @@ def enableProguardInReleaseBuilds = false
|
|
|
62
62
|
* The preferred build flavor of JavaScriptCore (JSC)
|
|
63
63
|
*
|
|
64
64
|
* For example, to use the international variant, you can use:
|
|
65
|
-
*
|
|
65
|
+
* def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
|
|
66
66
|
*
|
|
67
67
|
* The international variant includes ICU i18n library and necessary data
|
|
68
68
|
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
69
69
|
* give correct results when using with locales other than en-US. Note that
|
|
70
70
|
* this variant is about 6MiB larger per architecture than default.
|
|
71
71
|
*/
|
|
72
|
-
def jscFlavor = '
|
|
72
|
+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
|
|
73
73
|
|
|
74
74
|
android {
|
|
75
75
|
ndkVersion rootProject.ext.ndkVersion
|
|
@@ -117,6 +117,6 @@ dependencies {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
implementation 'com.google.android.gms:play-services-appset:16.0.2'
|
|
120
|
-
implementation 'com.tapjoy:tapjoy-android-sdk:14.
|
|
120
|
+
implementation 'com.tapjoy:tapjoy-android-sdk:14.4.0'
|
|
121
121
|
|
|
122
122
|
}
|
|
@@ -3,9 +3,9 @@ buildscript {
|
|
|
3
3
|
buildToolsVersion = "35.0.0"
|
|
4
4
|
minSdkVersion = 24
|
|
5
5
|
compileSdkVersion = 35
|
|
6
|
-
targetSdkVersion =
|
|
7
|
-
ndkVersion = "
|
|
8
|
-
kotlinVersion = "
|
|
6
|
+
targetSdkVersion = 35
|
|
7
|
+
ndkVersion = "27.1.12297006"
|
|
8
|
+
kotlinVersion = "2.0.21"
|
|
9
9
|
}
|
|
10
10
|
repositories {
|
|
11
11
|
google()
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
validateDistributionUrl=true
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
package/example/android/gradlew
CHANGED
|
@@ -86,8 +86,7 @@ done
|
|
|
86
86
|
# shellcheck disable=SC2034
|
|
87
87
|
APP_BASE_NAME=${0##*/}
|
|
88
88
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
89
|
-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
|
90
|
-
' "$PWD" ) || exit
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
91
90
|
|
|
92
91
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
93
92
|
MAX_FD=maximum
|
|
@@ -206,7 +205,7 @@ fi
|
|
|
206
205
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
207
206
|
|
|
208
207
|
# Collect all arguments for the java command:
|
|
209
|
-
# * DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
208
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
210
209
|
# and any embedded shellness will be escaped.
|
|
211
210
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
212
211
|
# treated as '${Hostname}' itself on the command line.
|
package/example/babel.config.js
CHANGED
|
@@ -4,14 +4,5 @@ const pak = require('../package.json');
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
presets: ['module:@react-native/babel-preset'],
|
|
6
6
|
plugins: [
|
|
7
|
-
[
|
|
8
|
-
'module-resolver',
|
|
9
|
-
{
|
|
10
|
-
extensions: ['.tsx', '.ts', '.js', '.json'],
|
|
11
|
-
alias: {
|
|
12
|
-
[pak.name]: path.join(__dirname, '..', pak.source),
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
7
|
],
|
|
17
8
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AppDelegate.swift
|
|
3
|
+
// TapjoyReactNativeSdkExample
|
|
4
|
+
//
|
|
5
|
+
// Created by Luke Bowman on 13/05/2025.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import UIKit
|
|
9
|
+
import React
|
|
10
|
+
import React_RCTAppDelegate
|
|
11
|
+
import ReactAppDependencyProvider
|
|
12
|
+
|
|
13
|
+
@main
|
|
14
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
15
|
+
var window: UIWindow?
|
|
16
|
+
|
|
17
|
+
var reactNativeDelegate: ReactNativeDelegate?
|
|
18
|
+
var reactNativeFactory: RCTReactNativeFactory?
|
|
19
|
+
|
|
20
|
+
func application(
|
|
21
|
+
_ application: UIApplication,
|
|
22
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
23
|
+
) -> Bool {
|
|
24
|
+
let delegate = ReactNativeDelegate()
|
|
25
|
+
let factory = RCTReactNativeFactory(delegate: delegate)
|
|
26
|
+
delegate.dependencyProvider = RCTAppDependencyProvider()
|
|
27
|
+
|
|
28
|
+
reactNativeDelegate = delegate
|
|
29
|
+
reactNativeFactory = factory
|
|
30
|
+
|
|
31
|
+
window = UIWindow(frame: UIScreen.main.bounds)
|
|
32
|
+
|
|
33
|
+
factory.startReactNative(
|
|
34
|
+
withModuleName: "TapjoyReactNativeSdkExample",
|
|
35
|
+
in: window,
|
|
36
|
+
launchOptions: launchOptions
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
|
|
44
|
+
override func sourceURL(for bridge: RCTBridge) -> URL? {
|
|
45
|
+
self.bundleURL()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
override func bundleURL() -> URL? {
|
|
49
|
+
#if DEBUG
|
|
50
|
+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
|
|
51
|
+
#else
|
|
52
|
+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
|
|
53
|
+
#endif
|
|
54
|
+
}
|
|
55
|
+
}
|
package/example/ios/Podfile
CHANGED
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
00E356F31AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.m */; };
|
|
11
10
|
0C80B921A6F3F58F76C31292 /* libPods-TapjoyReactNativeSdkExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-TapjoyReactNativeSdkExample.a */; };
|
|
12
|
-
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
|
|
13
11
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
|
14
|
-
|
|
12
|
+
5BA1D00A2DD34B1F00CF7906 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BA1D0092DD34B1600CF7906 /* AppDelegate.swift */; };
|
|
15
13
|
7699B88040F8A987B510C191 /* libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a */; };
|
|
16
14
|
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
|
17
15
|
B58E4E7E8EDB14A1C5F1CBAA /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */; };
|
|
@@ -29,23 +27,19 @@
|
|
|
29
27
|
|
|
30
28
|
/* Begin PBXFileReference section */
|
|
31
29
|
00E356EE1AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TapjoyReactNativeSdkExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
32
|
-
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
33
|
-
00E356F21AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TapjoyReactNativeSdkExampleTests.m; sourceTree = "<group>"; };
|
|
34
30
|
13B07F961A680F5B00A75B9A /* TapjoyReactNativeSdkExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TapjoyReactNativeSdkExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
35
|
-
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = TapjoyReactNativeSdkExample/AppDelegate.h; sourceTree = "<group>"; };
|
|
36
|
-
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = TapjoyReactNativeSdkExample/AppDelegate.mm; sourceTree = "<group>"; };
|
|
37
31
|
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = TapjoyReactNativeSdkExample/Images.xcassets; sourceTree = "<group>"; };
|
|
38
32
|
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = TapjoyReactNativeSdkExample/Info.plist; sourceTree = "<group>"; };
|
|
39
|
-
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TapjoyReactNativeSdkExample/main.m; sourceTree = "<group>"; };
|
|
40
33
|
19F6CBCC0A4E27FBF8BF4A61 /* libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
41
34
|
3B4392A12AC88292D35C810B /* Pods-TapjoyReactNativeSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample/Pods-TapjoyReactNativeSdkExample.debug.xcconfig"; sourceTree = "<group>"; };
|
|
42
35
|
5709B34CF0A7D63546082F79 /* Pods-TapjoyReactNativeSdkExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample.release.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample/Pods-TapjoyReactNativeSdkExample.release.xcconfig"; sourceTree = "<group>"; };
|
|
43
36
|
5B7EB9410499542E8C5724F5 /* Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests/Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
|
|
37
|
+
5BA1D0092DD34B1600CF7906 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
|
44
38
|
5DCACB8F33CDC322A6C60F78 /* libPods-TapjoyReactNativeSdkExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TapjoyReactNativeSdkExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
45
39
|
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = TapjoyReactNativeSdkExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
|
46
40
|
89C6BE57DB24E9ADA2F236DE /* Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.release.xcconfig"; path = "Target Support Files/Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests/Pods-TapjoyReactNativeSdkExample-TapjoyReactNativeSdkExampleTests.release.xcconfig"; sourceTree = "<group>"; };
|
|
47
41
|
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
|
48
|
-
EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = TapjoyReactNativeSdkExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
|
42
|
+
EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = TapjoyReactNativeSdkExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
|
49
43
|
/* End PBXFileReference section */
|
|
50
44
|
|
|
51
45
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -71,7 +65,6 @@
|
|
|
71
65
|
00E356EF1AD99517003FC87E /* TapjoyReactNativeSdkExampleTests */ = {
|
|
72
66
|
isa = PBXGroup;
|
|
73
67
|
children = (
|
|
74
|
-
00E356F21AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.m */,
|
|
75
68
|
00E356F01AD99517003FC87E /* Supporting Files */,
|
|
76
69
|
);
|
|
77
70
|
path = TapjoyReactNativeSdkExampleTests;
|
|
@@ -80,7 +73,6 @@
|
|
|
80
73
|
00E356F01AD99517003FC87E /* Supporting Files */ = {
|
|
81
74
|
isa = PBXGroup;
|
|
82
75
|
children = (
|
|
83
|
-
00E356F11AD99517003FC87E /* Info.plist */,
|
|
84
76
|
);
|
|
85
77
|
name = "Supporting Files";
|
|
86
78
|
sourceTree = "<group>";
|
|
@@ -88,12 +80,10 @@
|
|
|
88
80
|
13B07FAE1A68108700A75B9A /* TapjoyReactNativeSdkExample */ = {
|
|
89
81
|
isa = PBXGroup;
|
|
90
82
|
children = (
|
|
91
|
-
|
|
92
|
-
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
|
|
83
|
+
5BA1D0092DD34B1600CF7906 /* AppDelegate.swift */,
|
|
93
84
|
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
|
94
85
|
13B07FB61A68108700A75B9A /* Info.plist */,
|
|
95
86
|
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
|
96
|
-
13B07FB71A68108700A75B9A /* main.m */,
|
|
97
87
|
EDEB0408D1807C711EE2B6BB /* PrivacyInfo.xcprivacy */,
|
|
98
88
|
);
|
|
99
89
|
name = TapjoyReactNativeSdkExample;
|
|
@@ -408,7 +398,6 @@
|
|
|
408
398
|
isa = PBXSourcesBuildPhase;
|
|
409
399
|
buildActionMask = 2147483647;
|
|
410
400
|
files = (
|
|
411
|
-
00E356F31AD99517003FC87E /* TapjoyReactNativeSdkExampleTests.m in Sources */,
|
|
412
401
|
);
|
|
413
402
|
runOnlyForDeploymentPostprocessing = 0;
|
|
414
403
|
};
|
|
@@ -416,8 +405,7 @@
|
|
|
416
405
|
isa = PBXSourcesBuildPhase;
|
|
417
406
|
buildActionMask = 2147483647;
|
|
418
407
|
files = (
|
|
419
|
-
|
|
420
|
-
13B07FC11A68108700A75B9A /* main.m in Sources */,
|
|
408
|
+
5BA1D00A2DD34B1F00CF7906 /* AppDelegate.swift in Sources */,
|
|
421
409
|
);
|
|
422
410
|
runOnlyForDeploymentPostprocessing = 0;
|
|
423
411
|
};
|
package/example/metro.config.js
CHANGED
|
@@ -14,7 +14,7 @@ const modules = Object.keys({
|
|
|
14
14
|
* Metro configuration
|
|
15
15
|
* https://reactnative.dev/docs/metro
|
|
16
16
|
*
|
|
17
|
-
* @type {import('metro-config').MetroConfig}
|
|
17
|
+
* @type {import('@react-native/metro-config').MetroConfig}
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
module.exports = mergeConfig(getDefaultConfig(__dirname), {
|
package/example/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "TapjoyReactNativeSdkExample",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "react-native run-android",
|
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"tapjoy-react-native-sdk": "file:../",
|
|
13
|
-
"@react-native-async-storage/async-storage": "^2.
|
|
14
|
-
"@react-native-
|
|
15
|
-
"@react-native-picker/picker": "^2.
|
|
16
|
-
"@react-navigation/bottom-tabs": "^
|
|
17
|
-
"@react-navigation/native": "^
|
|
13
|
+
"@react-native-async-storage/async-storage": "^2.1.2",
|
|
14
|
+
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
15
|
+
"@react-native-picker/picker": "^2.11.0",
|
|
16
|
+
"@react-navigation/bottom-tabs": "^7.3.13",
|
|
17
|
+
"@react-navigation/native": "^7.1.9",
|
|
18
18
|
"dayjs": "^1.11.13",
|
|
19
|
-
"react": "
|
|
20
|
-
"react-native": "0.
|
|
19
|
+
"react": "19.0.0",
|
|
20
|
+
"react-native": "0.79.2",
|
|
21
21
|
"react-native-gesture-handler": "^2.20.0",
|
|
22
22
|
"react-native-picker-select": "^9.3.1",
|
|
23
23
|
"react-native-reanimated": "^3.15.3",
|
|
24
|
-
"react-native-safe-area-context": "^4.
|
|
25
|
-
"react-native-screens": "^
|
|
24
|
+
"react-native-safe-area-context": "^5.4.0",
|
|
25
|
+
"react-native-screens": "^4.10.0",
|
|
26
26
|
"react-native-toast-message": "^2.2.1",
|
|
27
27
|
"react-native-tracking-transparency": "^0.1.2"
|
|
28
28
|
},
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@babel/core": "^7.25.2",
|
|
31
31
|
"@babel/preset-env": "^7.25.4",
|
|
32
32
|
"@babel/runtime": "^7.25.6",
|
|
33
|
-
"@react-native-community/cli": "
|
|
34
|
-
"@react-native-community/cli-platform-android": "
|
|
35
|
-
"@react-native-community/cli-platform-ios": "
|
|
33
|
+
"@react-native-community/cli": "18.0.0",
|
|
34
|
+
"@react-native-community/cli-platform-android": "18.0.0",
|
|
35
|
+
"@react-native-community/cli-platform-ios": "18.0.0",
|
|
36
|
+
"@react-native/babel-preset": "0.79.2",
|
|
36
37
|
"@react-native/metro-config": "^0.76.6",
|
|
37
|
-
"
|
|
38
|
-
"metro-react-native-babel-preset": "0.77.0"
|
|
38
|
+
"@react-native/typescript-config": "0.79.2"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=18"
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
} from 'react-native-tracking-transparency';
|
|
15
15
|
import styles from './Styles';
|
|
16
16
|
import Button from './Button';
|
|
17
|
-
import Tapjoy, { TJVersion, TapjoyEvent } from 'tapjoy-react-native-sdk';
|
|
17
|
+
import Tapjoy, { TJVersion, TapjoyEvent, TJLoggingLevel } from 'tapjoy-react-native-sdk';
|
|
18
18
|
import { ConnectContext } from './ConnectContext';
|
|
19
|
+
import SelectionMenu from './SelectionMenu';
|
|
19
20
|
|
|
20
21
|
const MainScreen: React.FC = () => {
|
|
21
22
|
const [sdkKey, setSdkKey] = useState<string>('');
|
|
@@ -23,7 +24,15 @@ const MainScreen: React.FC = () => {
|
|
|
23
24
|
const [curerncySpendAwardAmount, setCurrencySpendAwardAmount] = useState<string>('10');
|
|
24
25
|
const [statusLabelText, setStatusLabelText] = useState('Status Message');
|
|
25
26
|
const { isSdkConnected, setIsSdkConnected } = useContext(ConnectContext);
|
|
26
|
-
|
|
27
|
+
const [selectedLoggingLevel, setSelectedLoggingLevel] = useState<TJLoggingLevel>(
|
|
28
|
+
TJLoggingLevel.Error
|
|
29
|
+
);
|
|
30
|
+
const loggingLevelData = [
|
|
31
|
+
{ value: TJLoggingLevel.Error, label: 'Error' },
|
|
32
|
+
{ value: TJLoggingLevel.Warning, label: 'Warning' },
|
|
33
|
+
{ value: TJLoggingLevel.Info, label: 'Info' },
|
|
34
|
+
{ value: TJLoggingLevel.Debug, label: 'Debug' },
|
|
35
|
+
];
|
|
27
36
|
useEffect(() => {
|
|
28
37
|
retrieveSdkKey().then();
|
|
29
38
|
}, []);
|
|
@@ -50,9 +59,13 @@ const MainScreen: React.FC = () => {
|
|
|
50
59
|
setIsConnecting(true);
|
|
51
60
|
await AsyncStorage.setItem('sdkKey', sdkKey);
|
|
52
61
|
|
|
53
|
-
Tapjoy.
|
|
54
|
-
|
|
55
|
-
//
|
|
62
|
+
Tapjoy.setLoggingLevel(selectedLoggingLevel);
|
|
63
|
+
|
|
64
|
+
// Use the following code to set the user id and logging level using connect flags
|
|
65
|
+
// let flags: object = {
|
|
66
|
+
// TJC_OPTION_USER_ID: "userId",
|
|
67
|
+
// TJC_OPTION_LOGGING_LEVEL: TJLoggingLevel.Debug
|
|
68
|
+
// };
|
|
56
69
|
let flags: object = {};
|
|
57
70
|
let trackingStatus = await getTrackingStatus();
|
|
58
71
|
if (trackingStatus !== 'authorized' && trackingStatus !== 'unavailable') {
|
|
@@ -64,6 +77,8 @@ const MainScreen: React.FC = () => {
|
|
|
64
77
|
},
|
|
65
78
|
);
|
|
66
79
|
setIsConnecting(false);
|
|
80
|
+
setSelectedLoggingLevel(await Tapjoy.getLoggingLevel());
|
|
81
|
+
Tapjoy.setCustomParameter("my_parameter");
|
|
67
82
|
setStatusLabelText(
|
|
68
83
|
'Tapjoy SDK Connected' +
|
|
69
84
|
(Object.keys(flags).length > 0
|
|
@@ -130,6 +145,15 @@ const MainScreen: React.FC = () => {
|
|
|
130
145
|
setCurrencySpendAwardAmount(numericText);
|
|
131
146
|
};
|
|
132
147
|
|
|
148
|
+
const handleLoggingLevelChange = async (item: { value: TJLoggingLevel }) => {
|
|
149
|
+
setSelectedLoggingLevel(item.value);
|
|
150
|
+
const originalLoggingLevel = await Tapjoy.getLoggingLevel();
|
|
151
|
+
await Tapjoy.setLoggingLevel(item.value);
|
|
152
|
+
if (await Tapjoy.getLoggingLevel() !== item.value) {
|
|
153
|
+
setSelectedLoggingLevel(originalLoggingLevel); // Revert to the original value if logging level is locked
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
133
157
|
return (
|
|
134
158
|
<View style={styles.mainContainer}>
|
|
135
159
|
<ScrollView>
|
|
@@ -176,6 +200,16 @@ const MainScreen: React.FC = () => {
|
|
|
176
200
|
/>
|
|
177
201
|
<Button title="Award" onPress={awardCurrency} />
|
|
178
202
|
</View>
|
|
203
|
+
<View style={styles.selectionContainer}>
|
|
204
|
+
<View style={styles.horizontalContainer}>
|
|
205
|
+
<Text style={styles.userPropertiesLabel}>Logging Level:</Text>
|
|
206
|
+
<SelectionMenu
|
|
207
|
+
data={loggingLevelData}
|
|
208
|
+
onSelectItem={handleLoggingLevelChange}
|
|
209
|
+
initialSelectedItem={loggingLevelData[selectedLoggingLevel]}
|
|
210
|
+
/>
|
|
211
|
+
</View>
|
|
212
|
+
</View>
|
|
179
213
|
</View>
|
|
180
214
|
</SafeAreaView>
|
|
181
215
|
</ScrollView>
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
#pragma mark - SDK
|
|
7
7
|
RCT_EXTERN_METHOD(connect:(NSString *)sdkKey connectFlags:(NSDictionary *)connectFlags resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
8
|
-
RCT_EXTERN_METHOD(
|
|
8
|
+
RCT_EXTERN_METHOD(setLoggingLevel:(NSNumber *)loggingLevel)
|
|
9
|
+
RCT_EXTERN_METHOD(getLoggingLevel:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
9
10
|
RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(isConnected)
|
|
11
|
+
RCT_EXTERN_METHOD(setCustomParameter:(NSString *)customParameter)
|
|
12
|
+
RCT_EXTERN_METHOD(getCustomParameter:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
10
13
|
RCT_EXTERN_METHOD(setUserId:(NSString *)userId resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
11
14
|
RCT_EXTERN_METHOD(getUserId:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
12
15
|
RCT_EXTERN_METHOD(setUserSegment:(nonnull NSNumber *)userSegment)
|
|
@@ -93,12 +93,12 @@ class TapjoyReactNativeSdk: RCTEventEmitter {
|
|
|
93
93
|
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(TJC_CONNECT_FAILED), object: nil)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@objc func
|
|
101
|
-
Tapjoy.
|
|
96
|
+
@objc func setLoggingLevel(_ loggingLevel: NSNumber) {
|
|
97
|
+
Tapjoy.loggingLevel = TJLoggerLevel(rawValue: loggingLevel.intValue) ?? .error
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@objc func getLoggingLevel(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
101
|
+
resolve(Tapjoy.loggingLevel.rawValue)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
@objc func isConnected() -> NSNumber {
|
|
@@ -119,6 +119,14 @@ class TapjoyReactNativeSdk: RCTEventEmitter {
|
|
|
119
119
|
resolve(Tapjoy.getUserID())
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
@objc func setCustomParameter(_ customParameter: String) {
|
|
123
|
+
Tapjoy.sharedTapjoyConnect().customParameter = customParameter
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@objc func getCustomParameter(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
127
|
+
resolve(Tapjoy.sharedTapjoyConnect().customParameter)
|
|
128
|
+
}
|
|
129
|
+
|
|
122
130
|
/**
|
|
123
131
|
* Sets the segment of the user
|
|
124
132
|
*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var TJLoggingLevel;
|
|
2
|
+
(function (TJLoggingLevel) {
|
|
3
|
+
TJLoggingLevel[TJLoggingLevel["Error"] = 0] = "Error";
|
|
4
|
+
TJLoggingLevel[TJLoggingLevel["Warning"] = 1] = "Warning";
|
|
5
|
+
TJLoggingLevel[TJLoggingLevel["Info"] = 2] = "Info";
|
|
6
|
+
TJLoggingLevel[TJLoggingLevel["Debug"] = 3] = "Debug";
|
|
7
|
+
})(TJLoggingLevel || (TJLoggingLevel = {}));
|
|
8
|
+
export default TJLoggingLevel;
|
package/lib/commonjs/Tapjoy.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NativeModules, Platform, NativeEventEmitter } from 'react-native';
|
|
2
2
|
import TJConnect from './TJConnect';
|
|
3
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
3
4
|
const LINKING_ERROR = `The package 'tapjoy-react-native-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
4
5
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
5
6
|
'- You rebuilt the app after installing the package\n' +
|
|
@@ -84,6 +85,29 @@ class Tapjoy {
|
|
|
84
85
|
TapjoyAPI.trackPurchase(currencyCode, price);
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
88
|
+
* Sets the logging level for Tapjoy.
|
|
89
|
+
*
|
|
90
|
+
* @param loggingLevel
|
|
91
|
+
* the logging level to set
|
|
92
|
+
* @see TJLoggingLevel
|
|
93
|
+
*/
|
|
94
|
+
static setLoggingLevel(loggingLevel) {
|
|
95
|
+
TapjoyAPI.setLoggingLevel(loggingLevel);
|
|
96
|
+
}
|
|
97
|
+
;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the current logging level for Tapjoy.
|
|
100
|
+
*
|
|
101
|
+
* @return the current logging level
|
|
102
|
+
* @see TJLoggingLevel
|
|
103
|
+
*/
|
|
104
|
+
static async getLoggingLevel() {
|
|
105
|
+
return await TapjoyAPI.getLoggingLevel();
|
|
106
|
+
}
|
|
107
|
+
;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Deprecated in 14.4.0 in favor of setLoggingLevel
|
|
110
|
+
*
|
|
87
111
|
* Enables or disables Tapjoy logging
|
|
88
112
|
*
|
|
89
113
|
* @param enable
|
|
@@ -91,7 +115,7 @@ class Tapjoy {
|
|
|
91
115
|
* logging
|
|
92
116
|
*/
|
|
93
117
|
static setDebugEnabled(enable) {
|
|
94
|
-
TapjoyAPI.
|
|
118
|
+
TapjoyAPI.setLoggingLevel(enable ? TJLoggingLevel.Debug : TJLoggingLevel.Error);
|
|
95
119
|
}
|
|
96
120
|
;
|
|
97
121
|
/**
|
|
@@ -208,5 +232,21 @@ class Tapjoy {
|
|
|
208
232
|
static removeUserTag(tag) {
|
|
209
233
|
TapjoyAPI.removeUserTag(tag);
|
|
210
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Assign a custom parameter associated with any following placement requests that contains an ad type. We will return this value on the currency callback.
|
|
237
|
+
* Only applicable for publishers who manage their own currency servers. This value does NOT get unset with each subsequent placement request.
|
|
238
|
+
* @param customParameter
|
|
239
|
+
* The custom parameter to assign to this device
|
|
240
|
+
*/
|
|
241
|
+
static setCustomParameter(customParameter) {
|
|
242
|
+
TapjoyAPI.setCustomParameter(customParameter);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Returns the currently set custom parameter.
|
|
246
|
+
* @return the value of the currently set custom parameter.
|
|
247
|
+
*/
|
|
248
|
+
static async getCustomParameter() {
|
|
249
|
+
return TapjoyAPI.getCustomParameter();
|
|
250
|
+
}
|
|
211
251
|
}
|
|
212
252
|
export default Tapjoy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/lib/commonjs/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import TJStatus from './TJStatus';
|
|
|
5
5
|
import TJSegment from './TJSegment';
|
|
6
6
|
import TJOfferwallDiscoverView from './TJOfferwallDiscoverView';
|
|
7
7
|
import TJPurchase from './TJPurchase';
|
|
8
|
+
import TJLoggingLevel from './TJLoggingLevel';
|
|
8
9
|
import Tapjoy from './Tapjoy';
|
|
9
|
-
export { Tapjoy, TJPlacement, TJPrivacyPolicy, TJVersion, TJStatus, TJSegment, TJOfferwallDiscoverView, TJPurchase, };
|
|
10
|
+
export { Tapjoy, TJPlacement, TJPrivacyPolicy, TJVersion, TJStatus, TJSegment, TJOfferwallDiscoverView, TJPurchase, TJLoggingLevel, };
|
|
10
11
|
export default Tapjoy;
|