tapjoy-react-native-sdk 14.4.0 → 14.6.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.
Files changed (54) hide show
  1. package/android/build.gradle +8 -15
  2. package/android/gradle.properties +3 -3
  3. package/android/src/main/java/com/tapjoyreactnativesdk/TJOfferwallDiscoverNativeView.kt +2 -2
  4. package/android/src/main/java/com/tapjoyreactnativesdk/TJOfferwallDiscoverNativeViewManager.kt +21 -16
  5. package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkModule.kt +130 -87
  6. package/android/src/main/java/com/tapjoyreactnativesdk/TapjoyReactNativeSdkPackage.kt +29 -5
  7. package/example/android/app/build.gradle +1 -1
  8. package/example/android/app/src/main/java/com/tapjoyreactnativesdkexample/MainApplication.kt +2 -8
  9. package/example/android/build.gradle +4 -4
  10. package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  11. package/example/android/gradle.properties +5 -0
  12. package/example/ios/Podfile +2 -1
  13. package/example/ios/TapjoyReactNativeSdkExample/Info.plist +3 -1
  14. package/example/ios/TapjoyReactNativeSdkExample.xcodeproj/project.pbxproj +0 -45
  15. package/example/metro.config.js +9 -15
  16. package/example/package.json +19 -16
  17. package/example/scripts/set-arch.sh +25 -0
  18. package/example/src/App.tsx +1 -2
  19. package/example/src/MainScreen.tsx +76 -60
  20. package/example/src/OfferwallDiscoverScreen.tsx +105 -91
  21. package/example/src/OfferwallScreen.tsx +170 -156
  22. package/example/src/Styles.ts +3 -2
  23. package/example/src/UserProperties.tsx +170 -136
  24. package/ios/TJOfferwallDiscoverNativeViewManager.m +11 -1
  25. package/ios/TJOfferwallDiscoverNativeViewManager.swift +2 -2
  26. package/ios/TapjoyReactNativeSdk.m +36 -15
  27. package/ios/TapjoyReactNativeSdk.swift +24 -4
  28. package/lib/commonjs/NativeTapjoyReactNativeSdk.js +2 -0
  29. package/lib/commonjs/TJOfferwallDiscoverView.js +43 -16
  30. package/lib/commonjs/TJOfferwallDiscoverViewNativeComponent.js +6 -0
  31. package/lib/commonjs/TJPlacement.js +17 -13
  32. package/lib/commonjs/TJPrivacyPolicy.js +81 -11
  33. package/lib/commonjs/TJVersion.js +1 -1
  34. package/lib/commonjs/Tapjoy.js +16 -10
  35. package/lib/commonjs/index.js +2 -1
  36. package/lib/commonjs/utils/ArchitectureDetection.js +7 -0
  37. package/lib/typescript/NativeTapjoyReactNativeSdk.d.ts +53 -0
  38. package/lib/typescript/TJOfferwallDiscoverView.d.ts +3 -12
  39. package/lib/typescript/TJOfferwallDiscoverViewNativeComponent.d.ts +21 -0
  40. package/lib/typescript/TJPrivacyPolicy.d.ts +29 -1
  41. package/lib/typescript/Tapjoy.d.ts +1 -1
  42. package/lib/typescript/index.d.ts +5 -3
  43. package/lib/typescript/utils/ArchitectureDetection.d.ts +5 -0
  44. package/package.json +14 -16
  45. package/src/NativeTapjoyReactNativeSdk.ts +117 -0
  46. package/src/TJOfferwallDiscoverView.tsx +56 -39
  47. package/src/TJOfferwallDiscoverViewNativeComponent.ts +37 -0
  48. package/src/TJPlacement.ts +17 -13
  49. package/src/TJPrivacyPolicy.ts +84 -12
  50. package/src/TJVersion.ts +1 -1
  51. package/src/Tapjoy.ts +20 -13
  52. package/src/index.ts +13 -3
  53. package/src/utils/ArchitectureDetection.ts +14 -0
  54. package/tapjoy-react-native-sdk.podspec +1 -1
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:8.1.2"
11
+ classpath "com.android.tools.build:gradle:8.11.1"
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"
@@ -21,12 +21,7 @@ def isNewArchitectureEnabled() {
21
21
 
22
22
  apply plugin: "com.android.library"
23
23
  apply plugin: "kotlin-android"
24
-
25
- def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
26
-
27
- if (isNewArchitectureEnabled()) {
28
- apply plugin: "com.facebook.react"
29
- }
24
+ apply plugin: "com.facebook.react"
30
25
 
31
26
  def getExtOrDefault(name) {
32
27
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["TapjoyReactNativeSdk_" + name]
@@ -79,16 +74,14 @@ dependencies {
79
74
  // For < 0.71, this will be from the local maven repo
80
75
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
81
76
  //noinspection GradleDynamicVersion
82
- implementation 'com.facebook.react:react-native:0.74.1'
77
+ implementation 'com.facebook.react:react-native:0.81.0'
83
78
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
84
- implementation 'com.tapjoy:tapjoy-android-sdk:14.4.0'
79
+ implementation 'com.tapjoy:tapjoy-android-sdk:14.6.0'
85
80
  implementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
86
81
  }
87
82
 
88
- if (isNewArchitectureEnabled()) {
89
- react {
90
- jsRootDir = file("../src/")
91
- libraryName = "TapjoyReactNativeSdk"
92
- codegenJavaPackageName = "com.tapjoyreactnativesdk"
93
- }
83
+ react {
84
+ jsRootDir = file("../src/")
85
+ libraryName = "TapjoyReactNativeSdk"
86
+ codegenJavaPackageName = "com.tapjoyreactnativesdk"
94
87
  }
@@ -1,6 +1,6 @@
1
- TapjoyReactNativeSdk_kotlinVersion=1.9.24
1
+ TapjoyReactNativeSdk_kotlinVersion=2.1.20
2
2
  TapjoyReactNativeSdk_minSdkVersion=21
3
- TapjoyReactNativeSdk_targetSdkVersion=34
4
- TapjoyReactNativeSdk_compileSdkVersion=34
3
+ TapjoyReactNativeSdk_targetSdkVersion=36
4
+ TapjoyReactNativeSdk_compileSdkVersion=36
5
5
  TapjoyReactNativeSdk_ndkversion=25.1.8937393
6
6
  android.useAndroidX=true
@@ -79,8 +79,8 @@ class TJOfferwallDiscoverNativeView : TJOfferwallDiscoverView, TJOfferwallDiscov
79
79
  }
80
80
  }
81
81
 
82
- class OfferwallDiscoverEvent(surfaceId: Int, viewId: Int, private val eventName: String, private val data: WritableMap) : Event<OfferwallDiscoverEvent>(surfaceId, viewId) {
83
- override fun getEventName() = eventName
82
+ class OfferwallDiscoverEvent(surfaceId: Int, viewId: Int, private val name: String, private val data: WritableMap) : Event<OfferwallDiscoverEvent>(surfaceId, viewId) {
83
+ override fun getEventName() = name
84
84
 
85
85
  // All events for a given view can be coalesced.
86
86
  override fun getCoalescingKey(): Short = 0
@@ -3,23 +3,16 @@ package com.tapjoyreactnativesdk
3
3
  import com.facebook.react.bridge.ReactApplicationContext
4
4
  import com.facebook.react.bridge.ReadableArray
5
5
  import com.facebook.react.common.MapBuilder
6
+ import com.facebook.react.module.annotations.ReactModule
6
7
  import com.facebook.react.uimanager.SimpleViewManager
7
8
  import com.facebook.react.uimanager.ThemedReactContext
9
+ import com.facebook.react.uimanager.annotations.ReactProp
8
10
 
9
- enum class Command(private val value:String) {
10
- REQUEST_CONTENT("requestContent"),
11
- CLEAR_CONTENT("clearContent");
12
-
13
- fun getValue(): String {
14
- return value
15
- }
16
- }
17
-
11
+ @ReactModule(name = TJOfferwallDiscoverNativeViewManager.REACT_CLASS)
18
12
  class TJOfferwallDiscoverNativeViewManager(
19
13
  private val callerContext: ReactApplicationContext
20
14
  ) : SimpleViewManager<TJOfferwallDiscoverNativeView>() {
21
15
 
22
- var view: TJOfferwallDiscoverNativeView? = null;
23
16
  override fun getName() = REACT_CLASS
24
17
 
25
18
  companion object {
@@ -32,15 +25,27 @@ class TJOfferwallDiscoverNativeViewManager(
32
25
 
33
26
  override fun receiveCommand(view: TJOfferwallDiscoverNativeView, commandId: String, args: ReadableArray?) {
34
27
  super.receiveCommand(view, commandId, args)
35
- if (commandId == Command.REQUEST_CONTENT.getValue()) {
36
- view.requestContent(args!!.getString(0) ?: " ")
37
- } else if (commandId == Command.CLEAR_CONTENT.getValue()) {
38
- view.clearContent()
28
+ when (commandId) {
29
+ "requestContent" -> {
30
+ args?.getString(0)?.let { placement ->
31
+ view.requestContent(placement)
32
+ }
33
+ }
34
+ "clearContent" -> {
35
+ view.clearContent()
36
+ }
39
37
  }
40
38
  }
41
39
 
42
- override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any?>? {
43
- return MapBuilder.of<String, Any?>(
40
+ override fun getCommandsMap(): Map<String, Int>? {
41
+ return MapBuilder.of(
42
+ "requestContent", 1,
43
+ "clearContent", 2
44
+ )
45
+ }
46
+
47
+ override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any>? {
48
+ return MapBuilder.of(
44
49
  "onRequestSuccess", MapBuilder.of("registrationName", "onRequestSuccess"),
45
50
  "onRequestFailure", MapBuilder.of("registrationName", "onRequestFailure"),
46
51
  "onContentReady", MapBuilder.of("registrationName", "onContentReady"),