@thealteroffice/react-native-adgeist 0.0.15 → 0.0.17

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 (28) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/generated/java/com/adgeist/NativeAdgeistSpec.java +83 -0
  3. package/android/generated/jni/CMakeLists.txt +36 -0
  4. package/android/generated/jni/RNAdgeistSpec-generated.cpp +98 -0
  5. package/android/generated/jni/RNAdgeistSpec.h +31 -0
  6. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +149 -0
  7. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +170 -0
  8. package/android/src/main/java/com/adgeist/implementation/AdgeistModuleImpl.kt +101 -9
  9. package/android/src/newarch/java/com/AdgeistModule.kt +93 -2
  10. package/android/src/oldarch/java/com/AdgeistModule.kt +101 -4
  11. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec-generated.mm +42 -7
  12. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec.h +57 -10
  13. package/ios/generated/RNAdgeistSpecJSI-generated.cpp +81 -14
  14. package/ios/generated/RNAdgeistSpecJSI.h +54 -9
  15. package/lib/module/NativeAdgeist.js.map +1 -1
  16. package/lib/module/components/BannerAd.js +164 -46
  17. package/lib/module/components/BannerAd.js.map +1 -1
  18. package/lib/module/utilities.js +16 -0
  19. package/lib/module/utilities.js.map +1 -0
  20. package/lib/typescript/src/NativeAdgeist.d.ts +6 -1
  21. package/lib/typescript/src/NativeAdgeist.d.ts.map +1 -1
  22. package/lib/typescript/src/components/BannerAd.d.ts.map +1 -1
  23. package/lib/typescript/src/utilities.d.ts +5 -0
  24. package/lib/typescript/src/utilities.d.ts.map +1 -0
  25. package/package.json +1 -1
  26. package/src/NativeAdgeist.ts +61 -9
  27. package/src/components/BannerAd.tsx +226 -63
  28. package/src/utilities.ts +13 -0
@@ -101,7 +101,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
101
101
 
102
102
  dependencies {
103
103
  implementation "com.facebook.react:react-android"
104
- implementation "ai.adgeist:adgeistkit:1.0.1"
104
+ implementation "ai.adgeist:adgeistkit:1.0.2"
105
105
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
106
106
  }
107
107
 
@@ -0,0 +1,83 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJavaSpec.js
9
+ *
10
+ * @nolint
11
+ */
12
+
13
+ package com.adgeist;
14
+
15
+ import com.facebook.proguard.annotations.DoNotStrip;
16
+ import com.facebook.react.bridge.Promise;
17
+ import com.facebook.react.bridge.ReactApplicationContext;
18
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
+ import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.bridge.ReadableMap;
21
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
22
+ import javax.annotation.Nonnull;
23
+
24
+ public abstract class NativeAdgeistSpec extends ReactContextBaseJavaModule implements TurboModule {
25
+ public static final String NAME = "Adgeist";
26
+
27
+ public NativeAdgeistSpec(ReactApplicationContext reactContext) {
28
+ super(reactContext);
29
+ }
30
+
31
+ @Override
32
+ public @Nonnull String getName() {
33
+ return NAME;
34
+ }
35
+
36
+ @ReactMethod
37
+ @DoNotStrip
38
+ public abstract void initializeSdk(String customDomain, Promise promise);
39
+
40
+ @ReactMethod
41
+ @DoNotStrip
42
+ public abstract void fetchCreative(String apiKey, String origin, String adSpaceId, String publisherId, boolean isTestEnvironment, Promise promise);
43
+
44
+ @ReactMethod
45
+ @DoNotStrip
46
+ public abstract void setUserDetails(ReadableMap user);
47
+
48
+ @ReactMethod
49
+ @DoNotStrip
50
+ public abstract void logEvent(ReadableMap event);
51
+
52
+ @ReactMethod
53
+ @DoNotStrip
54
+ public abstract void getConsentStatus(Promise promise);
55
+
56
+ @ReactMethod
57
+ @DoNotStrip
58
+ public abstract void updateConsentStatus(boolean consent);
59
+
60
+ @ReactMethod
61
+ @DoNotStrip
62
+ public abstract void trackImpression(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, double renderTime, Promise promise);
63
+
64
+ @ReactMethod
65
+ @DoNotStrip
66
+ public abstract void trackView(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible, Promise promise);
67
+
68
+ @ReactMethod
69
+ @DoNotStrip
70
+ public abstract void trackTotalView(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, double totalViewTime, double visibilityRatio, Promise promise);
71
+
72
+ @ReactMethod
73
+ @DoNotStrip
74
+ public abstract void trackClick(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, Promise promise);
75
+
76
+ @ReactMethod
77
+ @DoNotStrip
78
+ public abstract void trackVideoPlayback(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, double totalPlaybackTime, Promise promise);
79
+
80
+ @ReactMethod
81
+ @DoNotStrip
82
+ public abstract void trackVideoQuartile(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, String quartile, Promise promise);
83
+ }
@@ -0,0 +1,36 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ cmake_minimum_required(VERSION 3.13)
7
+ set(CMAKE_VERBOSE_MAKEFILE on)
8
+
9
+ file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNAdgeistSpec/*.cpp)
10
+
11
+ add_library(
12
+ react_codegen_RNAdgeistSpec
13
+ OBJECT
14
+ ${react_codegen_SRCS}
15
+ )
16
+
17
+ target_include_directories(react_codegen_RNAdgeistSpec PUBLIC . react/renderer/components/RNAdgeistSpec)
18
+
19
+ target_link_libraries(
20
+ react_codegen_RNAdgeistSpec
21
+ fbjni
22
+ jsi
23
+ # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
+ # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
+ reactnative
26
+ )
27
+
28
+ target_compile_options(
29
+ react_codegen_RNAdgeistSpec
30
+ PRIVATE
31
+ -DLOG_TAG=\"ReactNative\"
32
+ -fexceptions
33
+ -frtti
34
+ -std=c++20
35
+ -Wall
36
+ )
@@ -0,0 +1,98 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniCpp.js
9
+ */
10
+
11
+ #include "RNAdgeistSpec.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_initializeSdk(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
+ static jmethodID cachedMethodId = nullptr;
17
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initializeSdk", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
+ }
19
+
20
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_fetchCreative(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
+ static jmethodID cachedMethodId = nullptr;
22
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "fetchCreative", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
+ }
24
+
25
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_setUserDetails(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
26
+ static jmethodID cachedMethodId = nullptr;
27
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "setUserDetails", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
28
+ }
29
+
30
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_logEvent(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
+ static jmethodID cachedMethodId = nullptr;
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "logEvent", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
33
+ }
34
+
35
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_getConsentStatus(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
36
+ static jmethodID cachedMethodId = nullptr;
37
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getConsentStatus", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
38
+ }
39
+
40
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
41
+ static jmethodID cachedMethodId = nullptr;
42
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "updateConsentStatus", "(Z)V", args, count, cachedMethodId);
43
+ }
44
+
45
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackImpression(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
46
+ static jmethodID cachedMethodId = nullptr;
47
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackImpression", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
48
+ }
49
+
50
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
51
+ static jmethodID cachedMethodId = nullptr;
52
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackView", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZDDDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
53
+ }
54
+
55
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackTotalView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
56
+ static jmethodID cachedMethodId = nullptr;
57
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackTotalView", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
58
+ }
59
+
60
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackClick(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
61
+ static jmethodID cachedMethodId = nullptr;
62
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackClick", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
63
+ }
64
+
65
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
66
+ static jmethodID cachedMethodId = nullptr;
67
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackVideoPlayback", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
68
+ }
69
+
70
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoQuartile(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
71
+ static jmethodID cachedMethodId = nullptr;
72
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackVideoQuartile", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
73
+ }
74
+
75
+ NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params)
76
+ : JavaTurboModule(params) {
77
+ methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_initializeSdk};
78
+ methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
79
+ methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_setUserDetails};
80
+ methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_logEvent};
81
+ methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistSpecJSI_getConsentStatus};
82
+ methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus};
83
+ methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackImpression};
84
+ methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistSpecJSI_trackView};
85
+ methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistSpecJSI_trackTotalView};
86
+ methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistSpecJSI_trackClick};
87
+ methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback};
88
+ methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoQuartile};
89
+ }
90
+
91
+ std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
92
+ if (moduleName == "Adgeist") {
93
+ return std::make_shared<NativeAdgeistSpecJSI>(params);
94
+ }
95
+ return nullptr;
96
+ }
97
+
98
+ } // namespace facebook::react
@@ -0,0 +1,31 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <ReactCommon/JavaTurboModule.h>
14
+ #include <ReactCommon/TurboModule.h>
15
+ #include <jsi/jsi.h>
16
+
17
+ namespace facebook::react {
18
+
19
+ /**
20
+ * JNI C++ class for module 'NativeAdgeist'
21
+ */
22
+ class JSI_EXPORT NativeAdgeistSpecJSI : public JavaTurboModule {
23
+ public:
24
+ NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params);
25
+ };
26
+
27
+
28
+ JSI_EXPORT
29
+ std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
+
31
+ } // namespace facebook::react
@@ -0,0 +1,149 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleCpp.js
8
+ */
9
+
10
+ #include "RNAdgeistSpecJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->initializeSdk(
16
+ rt,
17
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
18
+ );
19
+ }
20
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
21
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
22
+ rt,
23
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
24
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
25
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
26
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
27
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asBool()
28
+ );
29
+ }
30
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
31
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->setUserDetails(
32
+ rt,
33
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
34
+ );
35
+ return jsi::Value::undefined();
36
+ }
37
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_logEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
38
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->logEvent(
39
+ rt,
40
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
41
+ );
42
+ return jsi::Value::undefined();
43
+ }
44
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
45
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->getConsentStatus(
46
+ rt
47
+ );
48
+ }
49
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
50
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->updateConsentStatus(
51
+ rt,
52
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
53
+ );
54
+ return jsi::Value::undefined();
55
+ }
56
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
57
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackImpression(
58
+ rt,
59
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
60
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
61
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
62
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
63
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
64
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
65
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
66
+ );
67
+ }
68
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
69
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackView(
70
+ rt,
71
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
72
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
73
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
74
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
75
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
76
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
77
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
78
+ count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(),
79
+ count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asNumber(),
80
+ count <= 9 ? throw jsi::JSError(rt, "Expected argument in position 9 to be passed") : args[9].asNumber()
81
+ );
82
+ }
83
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
84
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackTotalView(
85
+ rt,
86
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
87
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
88
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
89
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
90
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
91
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
92
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
93
+ count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber()
94
+ );
95
+ }
96
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackClick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
97
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackClick(
98
+ rt,
99
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
100
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
101
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
102
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
103
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
104
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool()
105
+ );
106
+ }
107
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
108
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoPlayback(
109
+ rt,
110
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
111
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
112
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
113
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
114
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
115
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
116
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
117
+ );
118
+ }
119
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoQuartile(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
120
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoQuartile(
121
+ rt,
122
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
123
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
124
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
125
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
126
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
127
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
128
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asString(rt)
129
+ );
130
+ }
131
+
132
+ NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
133
+ : TurboModule("Adgeist", jsInvoker) {
134
+ methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
135
+ methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
136
+ methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails};
137
+ methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_logEvent};
138
+ methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus};
139
+ methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus};
140
+ methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression};
141
+ methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistCxxSpecJSI_trackView};
142
+ methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
143
+ methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistCxxSpecJSI_trackClick};
144
+ methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback};
145
+ methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoQuartile};
146
+ }
147
+
148
+
149
+ } // namespace facebook::react
@@ -0,0 +1,170 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+ class JSI_EXPORT NativeAdgeistCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual jsi::Value initializeSdk(jsi::Runtime &rt, jsi::String customDomain) = 0;
24
+ virtual jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String apiKey, jsi::String origin, jsi::String adSpaceId, jsi::String publisherId, bool isTestEnvironment) = 0;
25
+ virtual void setUserDetails(jsi::Runtime &rt, jsi::Object user) = 0;
26
+ virtual void logEvent(jsi::Runtime &rt, jsi::Object event) = 0;
27
+ virtual jsi::Value getConsentStatus(jsi::Runtime &rt) = 0;
28
+ virtual void updateConsentStatus(jsi::Runtime &rt, bool consent) = 0;
29
+ virtual jsi::Value trackImpression(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double renderTime) = 0;
30
+ virtual jsi::Value trackView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible) = 0;
31
+ virtual jsi::Value trackTotalView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double totalViewTime, double visibilityRatio) = 0;
32
+ virtual jsi::Value trackClick(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment) = 0;
33
+ virtual jsi::Value trackVideoPlayback(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double totalPlaybackTime) = 0;
34
+ virtual jsi::Value trackVideoQuartile(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, jsi::String quartile) = 0;
35
+
36
+ };
37
+
38
+ template <typename T>
39
+ class JSI_EXPORT NativeAdgeistCxxSpec : public TurboModule {
40
+ public:
41
+ jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
42
+ return delegate_.create(rt, propName);
43
+ }
44
+
45
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
46
+ return delegate_.getPropertyNames(runtime);
47
+ }
48
+
49
+ static constexpr std::string_view kModuleName = "Adgeist";
50
+
51
+ protected:
52
+ NativeAdgeistCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
53
+ : TurboModule(std::string{NativeAdgeistCxxSpec::kModuleName}, jsInvoker),
54
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
55
+
56
+
57
+ private:
58
+ class Delegate : public NativeAdgeistCxxSpecJSI {
59
+ public:
60
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
61
+ NativeAdgeistCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
62
+
63
+ }
64
+
65
+ jsi::Value initializeSdk(jsi::Runtime &rt, jsi::String customDomain) override {
66
+ static_assert(
67
+ bridging::getParameterCount(&T::initializeSdk) == 2,
68
+ "Expected initializeSdk(...) to have 2 parameters");
69
+
70
+ return bridging::callFromJs<jsi::Value>(
71
+ rt, &T::initializeSdk, jsInvoker_, instance_, std::move(customDomain));
72
+ }
73
+ jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String apiKey, jsi::String origin, jsi::String adSpaceId, jsi::String publisherId, bool isTestEnvironment) override {
74
+ static_assert(
75
+ bridging::getParameterCount(&T::fetchCreative) == 6,
76
+ "Expected fetchCreative(...) to have 6 parameters");
77
+
78
+ return bridging::callFromJs<jsi::Value>(
79
+ rt, &T::fetchCreative, jsInvoker_, instance_, std::move(apiKey), std::move(origin), std::move(adSpaceId), std::move(publisherId), std::move(isTestEnvironment));
80
+ }
81
+ void setUserDetails(jsi::Runtime &rt, jsi::Object user) override {
82
+ static_assert(
83
+ bridging::getParameterCount(&T::setUserDetails) == 2,
84
+ "Expected setUserDetails(...) to have 2 parameters");
85
+
86
+ return bridging::callFromJs<void>(
87
+ rt, &T::setUserDetails, jsInvoker_, instance_, std::move(user));
88
+ }
89
+ void logEvent(jsi::Runtime &rt, jsi::Object event) override {
90
+ static_assert(
91
+ bridging::getParameterCount(&T::logEvent) == 2,
92
+ "Expected logEvent(...) to have 2 parameters");
93
+
94
+ return bridging::callFromJs<void>(
95
+ rt, &T::logEvent, jsInvoker_, instance_, std::move(event));
96
+ }
97
+ jsi::Value getConsentStatus(jsi::Runtime &rt) override {
98
+ static_assert(
99
+ bridging::getParameterCount(&T::getConsentStatus) == 1,
100
+ "Expected getConsentStatus(...) to have 1 parameters");
101
+
102
+ return bridging::callFromJs<jsi::Value>(
103
+ rt, &T::getConsentStatus, jsInvoker_, instance_);
104
+ }
105
+ void updateConsentStatus(jsi::Runtime &rt, bool consent) override {
106
+ static_assert(
107
+ bridging::getParameterCount(&T::updateConsentStatus) == 2,
108
+ "Expected updateConsentStatus(...) to have 2 parameters");
109
+
110
+ return bridging::callFromJs<void>(
111
+ rt, &T::updateConsentStatus, jsInvoker_, instance_, std::move(consent));
112
+ }
113
+ jsi::Value trackImpression(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double renderTime) override {
114
+ static_assert(
115
+ bridging::getParameterCount(&T::trackImpression) == 8,
116
+ "Expected trackImpression(...) to have 8 parameters");
117
+
118
+ return bridging::callFromJs<jsi::Value>(
119
+ rt, &T::trackImpression, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment), std::move(renderTime));
120
+ }
121
+ jsi::Value trackView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible) override {
122
+ static_assert(
123
+ bridging::getParameterCount(&T::trackView) == 11,
124
+ "Expected trackView(...) to have 11 parameters");
125
+
126
+ return bridging::callFromJs<jsi::Value>(
127
+ rt, &T::trackView, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment), std::move(viewTime), std::move(visibilityRatio), std::move(scrollDepth), std::move(timeToVisible));
128
+ }
129
+ jsi::Value trackTotalView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double totalViewTime, double visibilityRatio) override {
130
+ static_assert(
131
+ bridging::getParameterCount(&T::trackTotalView) == 9,
132
+ "Expected trackTotalView(...) to have 9 parameters");
133
+
134
+ return bridging::callFromJs<jsi::Value>(
135
+ rt, &T::trackTotalView, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment), std::move(totalViewTime), std::move(visibilityRatio));
136
+ }
137
+ jsi::Value trackClick(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment) override {
138
+ static_assert(
139
+ bridging::getParameterCount(&T::trackClick) == 7,
140
+ "Expected trackClick(...) to have 7 parameters");
141
+
142
+ return bridging::callFromJs<jsi::Value>(
143
+ rt, &T::trackClick, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment));
144
+ }
145
+ jsi::Value trackVideoPlayback(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, double totalPlaybackTime) override {
146
+ static_assert(
147
+ bridging::getParameterCount(&T::trackVideoPlayback) == 8,
148
+ "Expected trackVideoPlayback(...) to have 8 parameters");
149
+
150
+ return bridging::callFromJs<jsi::Value>(
151
+ rt, &T::trackVideoPlayback, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment), std::move(totalPlaybackTime));
152
+ }
153
+ jsi::Value trackVideoQuartile(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment, jsi::String quartile) override {
154
+ static_assert(
155
+ bridging::getParameterCount(&T::trackVideoQuartile) == 8,
156
+ "Expected trackVideoQuartile(...) to have 8 parameters");
157
+
158
+ return bridging::callFromJs<jsi::Value>(
159
+ rt, &T::trackVideoQuartile, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment), std::move(quartile));
160
+ }
161
+
162
+ private:
163
+ friend class NativeAdgeistCxxSpec;
164
+ T *instance_;
165
+ };
166
+
167
+ Delegate delegate_;
168
+ };
169
+
170
+ } // namespace facebook::react