@thealteroffice/react-native-adgeist 0.0.26-beta → 0.0.28-beta

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 (67) hide show
  1. package/Adgeist.podspec +3 -4
  2. package/README.md +48 -11
  3. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAdgeistSpec.java +84 -0
  4. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +55 -0
  5. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +24 -0
  6. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  7. package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec-generated.cpp +98 -0
  8. package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec.h +31 -0
  9. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
  10. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +24 -0
  11. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +60 -0
  12. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +49 -0
  13. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +28 -0
  14. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.h +52 -0
  15. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +142 -0
  16. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +170 -0
  17. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +17 -0
  18. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +32 -0
  19. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.cpp +16 -0
  20. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.h +29 -0
  21. package/android/build.gradle +1 -1
  22. package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +11 -5
  23. package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +8 -2
  24. package/android/src/newarch/java/com/Adgeist.kt +6 -3
  25. package/android/src/newarch/java/com/HTML5AdViewManager.kt +2 -5
  26. package/android/src/oldarch/java/com/Adgeist.kt +7 -2
  27. package/android/src/oldarch/java/com/HTML5AdViewManager.kt +33 -0
  28. package/ios/Adgeist.mm +6 -0
  29. package/ios/AdgeistImpl.swift +10 -1
  30. package/ios/NativeHTML5AdManager.h +12 -1
  31. package/ios/NativeHTML5AdManager.mm +115 -5
  32. package/ios/NativeHTML5AdView.swift +62 -13
  33. package/ios/adgeist-Bridging-Header.h +1 -0
  34. package/lib/module/components/HTML5AdView.js +3 -3
  35. package/lib/module/components/HTML5AdView.js.map +1 -1
  36. package/lib/module/constants.js +2 -0
  37. package/lib/module/constants.js.map +1 -1
  38. package/lib/module/index.js +1 -0
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/providers/AdgeistProvider.js +4 -3
  41. package/lib/module/providers/AdgeistProvider.js.map +1 -1
  42. package/lib/module/specs/HTML5AdNativeComponent.ts +38 -0
  43. package/lib/module/specs/NativeAdgeist.js.map +1 -1
  44. package/lib/module/utmtracker/index.js +25 -0
  45. package/lib/module/utmtracker/index.js.map +1 -0
  46. package/lib/typescript/src/constants.d.ts +2 -0
  47. package/lib/typescript/src/constants.d.ts.map +1 -1
  48. package/lib/typescript/src/index.d.ts +1 -0
  49. package/lib/typescript/src/index.d.ts.map +1 -1
  50. package/lib/typescript/src/providers/AdgeistProvider.d.ts.map +1 -1
  51. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts +4 -0
  52. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -1
  53. package/lib/typescript/src/specs/NativeAdgeist.d.ts +2 -1
  54. package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -1
  55. package/lib/typescript/src/types/Provider.d.ts +3 -3
  56. package/lib/typescript/src/types/Provider.d.ts.map +1 -1
  57. package/lib/typescript/src/utmtracker/index.d.ts +6 -0
  58. package/lib/typescript/src/utmtracker/index.d.ts.map +1 -0
  59. package/package.json +8 -4
  60. package/src/components/HTML5AdView.tsx +3 -3
  61. package/src/constants.ts +3 -0
  62. package/src/index.tsx +3 -0
  63. package/src/providers/AdgeistProvider.tsx +5 -3
  64. package/src/specs/HTML5AdNativeComponent.ts +38 -0
  65. package/src/specs/NativeAdgeist.ts +6 -3
  66. package/src/types/Provider.ts +3 -3
  67. package/src/utmtracker/index.ts +26 -0
@@ -0,0 +1,52 @@
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: GeneratePropsH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewProps.h>
13
+ #include <react/renderer/core/PropsParserContext.h>
14
+ #include <react/renderer/core/propsConversions.h>
15
+
16
+ namespace facebook::react {
17
+
18
+ struct HTML5AdNativeComponentAdSizeStruct {
19
+ double width{0.0};
20
+ double height{0.0};
21
+ };
22
+
23
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, HTML5AdNativeComponentAdSizeStruct &result) {
24
+ auto map = (std::unordered_map<std::string, RawValue>)value;
25
+
26
+ auto tmp_width = map.find("width");
27
+ if (tmp_width != map.end()) {
28
+ fromRawValue(context, tmp_width->second, result.width);
29
+ }
30
+ auto tmp_height = map.find("height");
31
+ if (tmp_height != map.end()) {
32
+ fromRawValue(context, tmp_height->second, result.height);
33
+ }
34
+ }
35
+
36
+ static inline std::string toString(const HTML5AdNativeComponentAdSizeStruct &value) {
37
+ return "[Object HTML5AdNativeComponentAdSizeStruct]";
38
+ }
39
+ class HTML5AdNativeComponentProps final : public ViewProps {
40
+ public:
41
+ HTML5AdNativeComponentProps() = default;
42
+ HTML5AdNativeComponentProps(const PropsParserContext& context, const HTML5AdNativeComponentProps &sourceProps, const RawProps &rawProps);
43
+
44
+ #pragma mark - Props
45
+
46
+ std::string adUnitID{};
47
+ bool adIsResponsive{false};
48
+ HTML5AdNativeComponentAdSizeStruct adSize{};
49
+ std::string adType{};
50
+ };
51
+
52
+ } // namespace facebook::react
@@ -0,0 +1,142 @@
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 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)),
18
+ count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)),
19
+ count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asString(rt)),
20
+ count <= 3 || args[3].isNull() || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asString(rt))
21
+ );
22
+ }
23
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_destroySdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
24
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->destroySdk(
25
+ rt
26
+ );
27
+ }
28
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
29
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
30
+ rt,
31
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
32
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
33
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool()
34
+ );
35
+ }
36
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
37
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->setUserDetails(
38
+ rt,
39
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
40
+ );
41
+ return jsi::Value::undefined();
42
+ }
43
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_logEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
44
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->logEvent(
45
+ rt,
46
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
47
+ );
48
+ return jsi::Value::undefined();
49
+ }
50
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
51
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->getConsentStatus(
52
+ rt
53
+ );
54
+ }
55
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
56
+ static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->updateConsentStatus(
57
+ rt,
58
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
59
+ );
60
+ return jsi::Value::undefined();
61
+ }
62
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
63
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackImpression(
64
+ rt,
65
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
66
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
67
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
68
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
69
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
70
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
71
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
72
+ );
73
+ }
74
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
75
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackView(
76
+ rt,
77
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
78
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
79
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
80
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
81
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
82
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
83
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
84
+ count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(),
85
+ count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asNumber(),
86
+ count <= 9 ? throw jsi::JSError(rt, "Expected argument in position 9 to be passed") : args[9].asNumber()
87
+ );
88
+ }
89
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
90
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackTotalView(
91
+ rt,
92
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
93
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
94
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
95
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
96
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
97
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
98
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
99
+ );
100
+ }
101
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackClick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
102
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackClick(
103
+ rt,
104
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
105
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
106
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
107
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
108
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
109
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool()
110
+ );
111
+ }
112
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
113
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoPlayback(
114
+ rt,
115
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
116
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
117
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
118
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
119
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
120
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
121
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
122
+ );
123
+ }
124
+
125
+ NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
126
+ : TurboModule("Adgeist", jsInvoker) {
127
+ methodMap_["initializeSdk"] = MethodMetadata {4, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
128
+ methodMap_["destroySdk"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_destroySdk};
129
+ methodMap_["fetchCreative"] = MethodMetadata {3, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
130
+ methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails};
131
+ methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_logEvent};
132
+ methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus};
133
+ methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus};
134
+ methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression};
135
+ methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistCxxSpecJSI_trackView};
136
+ methodMap_["trackTotalView"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
137
+ methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistCxxSpecJSI_trackClick};
138
+ methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback};
139
+ }
140
+
141
+
142
+ } // 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, std::optional<jsi::String> customBidRequestBackendDomain, std::optional<jsi::String> customPackageOrBundleID, std::optional<jsi::String> customAdgeistAppID, std::optional<jsi::String> customVersioning) = 0;
24
+ virtual jsi::Value destroySdk(jsi::Runtime &rt) = 0;
25
+ virtual jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String buyType, bool isTestEnvironment) = 0;
26
+ virtual void setUserDetails(jsi::Runtime &rt, jsi::Object user) = 0;
27
+ virtual void logEvent(jsi::Runtime &rt, jsi::Object event) = 0;
28
+ virtual jsi::Value getConsentStatus(jsi::Runtime &rt) = 0;
29
+ virtual void updateConsentStatus(jsi::Runtime &rt, bool consent) = 0;
30
+ virtual jsi::Value trackImpression(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double renderTime) = 0;
31
+ virtual jsi::Value trackView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible) = 0;
32
+ virtual jsi::Value trackTotalView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double totalViewTime) = 0;
33
+ virtual jsi::Value trackClick(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment) = 0;
34
+ virtual jsi::Value trackVideoPlayback(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double totalPlaybackTime) = 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, std::optional<jsi::String> customBidRequestBackendDomain, std::optional<jsi::String> customPackageOrBundleID, std::optional<jsi::String> customAdgeistAppID, std::optional<jsi::String> customVersioning) override {
66
+ static_assert(
67
+ bridging::getParameterCount(&T::initializeSdk) == 5,
68
+ "Expected initializeSdk(...) to have 5 parameters");
69
+
70
+ return bridging::callFromJs<jsi::Value>(
71
+ rt, &T::initializeSdk, jsInvoker_, instance_, std::move(customBidRequestBackendDomain), std::move(customPackageOrBundleID), std::move(customAdgeistAppID), std::move(customVersioning));
72
+ }
73
+ jsi::Value destroySdk(jsi::Runtime &rt) override {
74
+ static_assert(
75
+ bridging::getParameterCount(&T::destroySdk) == 1,
76
+ "Expected destroySdk(...) to have 1 parameters");
77
+
78
+ return bridging::callFromJs<jsi::Value>(
79
+ rt, &T::destroySdk, jsInvoker_, instance_);
80
+ }
81
+ jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String buyType, bool isTestEnvironment) override {
82
+ static_assert(
83
+ bridging::getParameterCount(&T::fetchCreative) == 4,
84
+ "Expected fetchCreative(...) to have 4 parameters");
85
+
86
+ return bridging::callFromJs<jsi::Value>(
87
+ rt, &T::fetchCreative, jsInvoker_, instance_, std::move(adSpaceId), std::move(buyType), std::move(isTestEnvironment));
88
+ }
89
+ void setUserDetails(jsi::Runtime &rt, jsi::Object user) override {
90
+ static_assert(
91
+ bridging::getParameterCount(&T::setUserDetails) == 2,
92
+ "Expected setUserDetails(...) to have 2 parameters");
93
+
94
+ return bridging::callFromJs<void>(
95
+ rt, &T::setUserDetails, jsInvoker_, instance_, std::move(user));
96
+ }
97
+ void logEvent(jsi::Runtime &rt, jsi::Object event) override {
98
+ static_assert(
99
+ bridging::getParameterCount(&T::logEvent) == 2,
100
+ "Expected logEvent(...) to have 2 parameters");
101
+
102
+ return bridging::callFromJs<void>(
103
+ rt, &T::logEvent, jsInvoker_, instance_, std::move(event));
104
+ }
105
+ jsi::Value getConsentStatus(jsi::Runtime &rt) override {
106
+ static_assert(
107
+ bridging::getParameterCount(&T::getConsentStatus) == 1,
108
+ "Expected getConsentStatus(...) to have 1 parameters");
109
+
110
+ return bridging::callFromJs<jsi::Value>(
111
+ rt, &T::getConsentStatus, jsInvoker_, instance_);
112
+ }
113
+ void updateConsentStatus(jsi::Runtime &rt, bool consent) override {
114
+ static_assert(
115
+ bridging::getParameterCount(&T::updateConsentStatus) == 2,
116
+ "Expected updateConsentStatus(...) to have 2 parameters");
117
+
118
+ return bridging::callFromJs<void>(
119
+ rt, &T::updateConsentStatus, jsInvoker_, instance_, std::move(consent));
120
+ }
121
+ jsi::Value trackImpression(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double renderTime) override {
122
+ static_assert(
123
+ bridging::getParameterCount(&T::trackImpression) == 8,
124
+ "Expected trackImpression(...) to have 8 parameters");
125
+
126
+ return bridging::callFromJs<jsi::Value>(
127
+ rt, &T::trackImpression, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(bidId), std::move(bidMeta), std::move(buyType), std::move(isTestEnvironment), std::move(renderTime));
128
+ }
129
+ jsi::Value trackView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible) override {
130
+ static_assert(
131
+ bridging::getParameterCount(&T::trackView) == 11,
132
+ "Expected trackView(...) to have 11 parameters");
133
+
134
+ return bridging::callFromJs<jsi::Value>(
135
+ rt, &T::trackView, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(bidId), std::move(bidMeta), std::move(buyType), std::move(isTestEnvironment), std::move(viewTime), std::move(visibilityRatio), std::move(scrollDepth), std::move(timeToVisible));
136
+ }
137
+ jsi::Value trackTotalView(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double totalViewTime) override {
138
+ static_assert(
139
+ bridging::getParameterCount(&T::trackTotalView) == 8,
140
+ "Expected trackTotalView(...) to have 8 parameters");
141
+
142
+ return bridging::callFromJs<jsi::Value>(
143
+ rt, &T::trackTotalView, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(bidId), std::move(bidMeta), std::move(buyType), std::move(isTestEnvironment), std::move(totalViewTime));
144
+ }
145
+ jsi::Value trackClick(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment) override {
146
+ static_assert(
147
+ bridging::getParameterCount(&T::trackClick) == 7,
148
+ "Expected trackClick(...) to have 7 parameters");
149
+
150
+ return bridging::callFromJs<jsi::Value>(
151
+ rt, &T::trackClick, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(bidId), std::move(bidMeta), std::move(buyType), std::move(isTestEnvironment));
152
+ }
153
+ jsi::Value trackVideoPlayback(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String bidId, jsi::String bidMeta, jsi::String buyType, bool isTestEnvironment, double totalPlaybackTime) override {
154
+ static_assert(
155
+ bridging::getParameterCount(&T::trackVideoPlayback) == 8,
156
+ "Expected trackVideoPlayback(...) to have 8 parameters");
157
+
158
+ return bridging::callFromJs<jsi::Value>(
159
+ rt, &T::trackVideoPlayback, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(bidId), std::move(bidMeta), std::move(buyType), std::move(isTestEnvironment), std::move(totalPlaybackTime));
160
+ }
161
+
162
+ private:
163
+ friend class NativeAdgeistCxxSpec;
164
+ T *instance_;
165
+ };
166
+
167
+ Delegate delegate_;
168
+ };
169
+
170
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
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: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/RNAdgeistSpec/ShadowNodes.h>
12
+
13
+ namespace facebook::react {
14
+
15
+ extern const char HTML5AdNativeComponentComponentName[] = "HTML5AdNativeComponent";
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,32 @@
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: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <react/renderer/components/RNAdgeistSpec/EventEmitters.h>
14
+ #include <react/renderer/components/RNAdgeistSpec/Props.h>
15
+ #include <react/renderer/components/RNAdgeistSpec/States.h>
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+ JSI_EXPORT extern const char HTML5AdNativeComponentComponentName[];
22
+
23
+ /*
24
+ * `ShadowNode` for <HTML5AdNativeComponent> component.
25
+ */
26
+ using HTML5AdNativeComponentShadowNode = ConcreteViewShadowNode<
27
+ HTML5AdNativeComponentComponentName,
28
+ HTML5AdNativeComponentProps,
29
+ HTML5AdNativeComponentEventEmitter,
30
+ HTML5AdNativeComponentState>;
31
+
32
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
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: GenerateStateCpp.js
9
+ */
10
+ #include <react/renderer/components/RNAdgeistSpec/States.h>
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,29 @@
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: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+ class HTML5AdNativeComponentState {
18
+ public:
19
+ HTML5AdNativeComponentState() = default;
20
+
21
+ #ifdef ANDROID
22
+ HTML5AdNativeComponentState(HTML5AdNativeComponentState const &previousState, folly::dynamic data){};
23
+ folly::dynamic getDynamic() const {
24
+ return {};
25
+ };
26
+ #endif
27
+ };
28
+
29
+ } // namespace facebook::react
@@ -104,7 +104,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
104
104
 
105
105
  dependencies {
106
106
  implementation "com.facebook.react:react-android"
107
- implementation "ai.adgeist:adgeistkit:1.1.12-beta"
107
+ implementation "ai.adgeist:adgeistkit:1.1.17-beta"
108
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
109
109
  }
110
110
 
@@ -24,7 +24,9 @@ object HTML5AdViewManagerImpl {
24
24
  const val EVENT_AD_CLICKED = "onAdClicked"
25
25
 
26
26
  fun createViewInstance(reactContext: ThemedReactContext): AdView {
27
- return AdView(reactContext)
27
+ val adView = AdView(reactContext.applicationContext)
28
+ adView.setTag(com.facebook.react.R.id.view_tag_native_id, reactContext)
29
+ return adView
28
30
  }
29
31
 
30
32
  fun setAdUnitID(view: AdView, adUnitID: String?) {
@@ -117,9 +119,13 @@ object HTML5AdViewManagerImpl {
117
119
  }
118
120
 
119
121
  private fun sendEvent(view: AdView, eventName: String, params: WritableMap) {
120
- val reactContext = view.context as ThemedReactContext
121
- reactContext
122
- .getJSModule(RCTEventEmitter::class.java)
123
- .receiveEvent(view.id, eventName, params)
122
+ val reactContext = view.getTag(com.facebook.react.R.id.view_tag_native_id) as? ThemedReactContext
123
+ if (reactContext != null) {
124
+ reactContext
125
+ .getJSModule(RCTEventEmitter::class.java)
126
+ .receiveEvent(view.id, eventName, params)
127
+ } else {
128
+ Log.e(TAG, "Unable to send event $eventName: ThemedReactContext not found")
129
+ }
124
130
  }
125
131
  }
@@ -1,5 +1,6 @@
1
1
  package com.adgeist.modules
2
2
 
3
+ import android.net.Uri
3
4
  import android.util.Log
4
5
  import com.facebook.react.bridge.Promise
5
6
  import com.facebook.react.bridge.ReactApplicationContext
@@ -22,9 +23,9 @@ class AdgeistImpl internal constructor(private val context: ReactApplicationCont
22
23
  private var getAd: FetchCreative? = null
23
24
  private var postCreativeAnalytic: CreativeAnalytics? = null
24
25
 
25
- fun initializeSdk(customBidRequestBackendDomain: String?, customPackageOrBundleID: String?, customAdgeistAppID: String?, promise: Promise) {
26
+ fun initializeSdk(customBidRequestBackendDomain: String?, customPackageOrBundleID: String?, customAdgeistAppID: String?, customVersioning: String?, promise: Promise) {
26
27
  try {
27
- adgeistInstance = AdgeistCore.initialize(context.applicationContext, customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID)
28
+ adgeistInstance = AdgeistCore.initialize(context.applicationContext, customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, customVersioning)
28
29
  getAd = adgeistInstance?.getCreative()
29
30
  postCreativeAnalytic = adgeistInstance?.postCreativeAnalytics()
30
31
  promise.resolve("SDK initialized with domain: ${customBidRequestBackendDomain ?: "default"}")
@@ -105,6 +106,11 @@ class AdgeistImpl internal constructor(private val context: ReactApplicationCont
105
106
  adgeistInstance?.updateConsentStatus(consent)
106
107
  }
107
108
 
109
+ fun trackDeeplinkUtm(url: String) {
110
+ val uri = Uri.parse(url)
111
+ adgeistInstance?.trackUtmFromDeeplink(uri)
112
+ }
113
+
108
114
  companion object {
109
115
  const val NAME = "Adgeist"
110
116
  }
@@ -4,7 +4,6 @@ import com.facebook.react.bridge.Promise
4
4
  import com.facebook.react.bridge.ReactApplicationContext
5
5
  import com.adgeist.modules.AdgeistImpl
6
6
  import com.adgeistkit.ads.network.AnalyticsRequestDEPRECATED
7
-
8
7
  import com.facebook.react.bridge.ReadableMap
9
8
 
10
9
  class Adgeist internal constructor(reactContext: ReactApplicationContext) :
@@ -14,8 +13,8 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
14
13
 
15
14
  override fun getName(): String = AdgeistImpl.NAME
16
15
 
17
- override fun initializeSdk(customBidRequestBackendDomain: String, customPackageOrBundleID: String, customAdgeistAppID: String, promise: Promise) {
18
- implementation.initializeSdk(customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, promise)
16
+ override fun initializeSdk(customBidRequestBackendDomain: String?, customPackageOrBundleID: String?, customAdgeistAppID: String?, customVersioning: String? , promise: Promise) {
17
+ implementation.initializeSdk(customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, customVersioning, promise)
19
18
  }
20
19
 
21
20
  override fun destroySdk(promise: Promise) {
@@ -116,4 +115,8 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
116
115
  override fun updateConsentStatus(consent: Boolean) {
117
116
  implementation.updateConsentStatus(consent)
118
117
  }
118
+
119
+ override fun trackDeeplinkUtm(url: String) {
120
+ implementation.trackDeeplinkUtm(url)
121
+ }
119
122
  }
@@ -1,11 +1,8 @@
1
1
  package com.adgeist.components
2
2
 
3
- import android.content.res.Resources
4
3
  import android.util.Log
5
- import android.view.ViewGroup
6
4
  import androidx.annotation.RequiresPermission
7
5
  import com.adgeistkit.ads.AdView
8
- import com.facebook.react.bridge.ReadableArray
9
6
  import com.facebook.react.bridge.ReadableMap
10
7
  import com.facebook.react.common.MapBuilder
11
8
  import com.facebook.react.module.annotations.ReactModule
@@ -18,7 +15,7 @@ import com.facebook.react.viewmanagers.HTML5AdNativeComponentManagerInterface
18
15
 
19
16
  @ReactModule(name = HTML5AdViewManagerImpl.NAME)
20
17
  class HTML5AdViewManager : SimpleViewManager<AdView>(), HTML5AdNativeComponentManagerInterface<AdView> {
21
-
18
+
22
19
  private val mDelegate: ViewManagerDelegate<AdView> = HTML5AdNativeComponentManagerDelegate(this)
23
20
 
24
21
  override fun getDelegate(): ViewManagerDelegate<AdView> {
@@ -40,7 +37,7 @@ class HTML5AdViewManager : SimpleViewManager<AdView>(), HTML5AdNativeComponentMa
40
37
  override fun setAdIsResponsive(view: AdView, adIsResponsive: Boolean) {
41
38
  HTML5AdViewManagerImpl.setAdIsResponsive(view, adIsResponsive)
42
39
  }
43
-
40
+
44
41
  @ReactProp(name = "adSize")
45
42
  override fun setAdSize(view: AdView, adSizeMap: ReadableMap?) {
46
43
  HTML5AdViewManagerImpl.setAdSize(view, adSizeMap)
@@ -16,8 +16,8 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
16
16
  override fun getName(): String = AdgeistImpl.NAME
17
17
 
18
18
  @ReactMethod
19
- fun initializeSdk(customBidRequestBackendDomain: String, customPackageOrBundleID: String, customAdgeistAppID: String, promise: Promise) {
20
- implementation.initializeSdk(customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, promise)
19
+ fun initializeSdk(customBidRequestBackendDomain: String?, customPackageOrBundleID: String?, customAdgeistAppID: String?, customVersioning: String?, promise: Promise) {
20
+ implementation.initializeSdk(customBidRequestBackendDomain, customPackageOrBundleID, customAdgeistAppID, customVersioning, promise)
21
21
  }
22
22
 
23
23
  @ReactMethod
@@ -129,4 +129,9 @@ class Adgeist internal constructor(reactContext: ReactApplicationContext) :
129
129
  fun updateConsentStatus(consent: Boolean) {
130
130
  implementation.updateConsentStatus(consent)
131
131
  }
132
+
133
+ @ReactMethod
134
+ fun trackDeeplinkUtm(url: String) {
135
+ implementation.trackDeeplinkUtm(url)
136
+ }
132
137
  }