@thealteroffice/react-native-adgeist 0.0.20 → 0.0.22

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 (136) hide show
  1. package/Adgeist.podspec +1 -1
  2. package/README.md +70 -521
  3. package/android/build.gradle +6 -3
  4. package/android/generated/java/com/adgeist/NativeAdgeistSpec.java +11 -11
  5. package/android/generated/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +55 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +24 -0
  7. package/android/generated/jni/RNAdgeistSpec-generated.cpp +12 -12
  8. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
  9. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +24 -0
  10. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +60 -0
  11. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +49 -0
  12. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +28 -0
  13. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/Props.h +52 -0
  14. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +14 -22
  15. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +36 -36
  16. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +17 -0
  17. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +32 -0
  18. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/States.cpp +16 -0
  19. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/States.h +29 -0
  20. package/android/src/main/java/com/adgeist/AdgeistPackage.kt +8 -7
  21. package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +125 -0
  22. package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +114 -0
  23. package/android/src/main/java/com/adgeist/utils/CreativeExtensions.kt +151 -0
  24. package/android/src/newarch/java/com/Adgeist.kt +119 -0
  25. package/android/src/newarch/java/com/HTML5AdViewManager.kt +77 -0
  26. package/android/src/oldarch/java/com/Adgeist.kt +132 -0
  27. package/android/src/oldarch/java/com/HTML5AdViewManager.kt +63 -0
  28. package/ios/Adgeist-Bridging-Header.h +3 -0
  29. package/ios/Adgeist.h +1 -1
  30. package/ios/Adgeist.mm +71 -65
  31. package/ios/AdgeistImpl.swift +127 -132
  32. package/ios/NativeHTML5AdManager.h +9 -0
  33. package/ios/NativeHTML5AdManager.mm +178 -0
  34. package/ios/NativeHTML5AdView.swift +136 -0
  35. package/ios/generated/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
  36. package/ios/generated/RNAdgeistSpec/ComponentDescriptors.h +24 -0
  37. package/ios/generated/RNAdgeistSpec/EventEmitters.cpp +60 -0
  38. package/ios/generated/RNAdgeistSpec/EventEmitters.h +49 -0
  39. package/ios/generated/RNAdgeistSpec/Props.cpp +28 -0
  40. package/ios/generated/RNAdgeistSpec/Props.h +52 -0
  41. package/ios/generated/RNAdgeistSpec/RCTComponentViewHelpers.h +65 -0
  42. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec-generated.mm +17 -17
  43. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec.h +17 -25
  44. package/ios/generated/RNAdgeistSpec/ShadowNodes.cpp +17 -0
  45. package/ios/generated/RNAdgeistSpec/ShadowNodes.h +32 -0
  46. package/ios/generated/RNAdgeistSpec/States.cpp +16 -0
  47. package/ios/generated/RNAdgeistSpec/States.h +29 -0
  48. package/ios/generated/RNAdgeistSpecJSI-generated.cpp +14 -22
  49. package/ios/generated/RNAdgeistSpecJSI.h +36 -36
  50. package/lib/module/cdpclient/index.js +1 -25
  51. package/lib/module/cdpclient/index.js.map +1 -1
  52. package/lib/module/components/HTML5AdView.js +128 -0
  53. package/lib/module/components/HTML5AdView.js.map +1 -0
  54. package/lib/module/components/{BannerAd.js → deprecated/BannerAdView.js} +50 -79
  55. package/lib/module/components/deprecated/BannerAdView.js.map +1 -0
  56. package/lib/module/components/{ConsentModal.js → deprecated/ConsentModal.js} +2 -2
  57. package/lib/module/components/deprecated/ConsentModal.js.map +1 -0
  58. package/lib/module/constants.js +14 -0
  59. package/lib/module/constants.js.map +1 -0
  60. package/lib/module/index.js +3 -2
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/module/{components → providers}/AdgeistProvider.js +10 -35
  63. package/lib/module/providers/AdgeistProvider.js.map +1 -0
  64. package/lib/module/specs/HTML5AdNativeComponent.ts +46 -0
  65. package/lib/module/specs/NativeAdgeist.js.map +1 -0
  66. package/lib/module/types/AdSize.js +2 -0
  67. package/lib/module/types/AdSize.js.map +1 -0
  68. package/lib/module/types/CPMAdResponse.js +2 -0
  69. package/lib/module/types/CPMAdResponse.js.map +1 -0
  70. package/lib/module/types/FixedAdResponse.js +2 -0
  71. package/lib/module/types/FixedAdResponse.js.map +1 -0
  72. package/lib/module/types/HTML5AdNativeComponentProps.js +4 -0
  73. package/lib/module/types/HTML5AdNativeComponentProps.js.map +1 -0
  74. package/lib/module/types/Provider.js +2 -0
  75. package/lib/module/types/Provider.js.map +1 -0
  76. package/lib/typescript/src/cdpclient/index.d.ts +1 -21
  77. package/lib/typescript/src/cdpclient/index.d.ts.map +1 -1
  78. package/lib/typescript/src/components/HTML5AdView.d.ts +3 -0
  79. package/lib/typescript/src/components/HTML5AdView.d.ts.map +1 -0
  80. package/lib/typescript/src/components/deprecated/BannerAdView.d.ts +17 -0
  81. package/lib/typescript/src/components/deprecated/BannerAdView.d.ts.map +1 -0
  82. package/lib/typescript/src/components/deprecated/ConsentModal.d.ts.map +1 -0
  83. package/lib/typescript/src/constants.d.ts +10 -0
  84. package/lib/typescript/src/constants.d.ts.map +1 -0
  85. package/lib/typescript/src/index.d.ts +3 -2
  86. package/lib/typescript/src/index.d.ts.map +1 -1
  87. package/lib/typescript/src/providers/AdgeistProvider.d.ts +9 -0
  88. package/lib/typescript/src/providers/AdgeistProvider.d.ts.map +1 -0
  89. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts +29 -0
  90. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -0
  91. package/lib/typescript/src/specs/NativeAdgeist.d.ts +28 -0
  92. package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -0
  93. package/lib/typescript/src/types/AdSize.d.ts +5 -0
  94. package/lib/typescript/src/types/AdSize.d.ts.map +1 -0
  95. package/lib/typescript/src/types/CPMAdResponse.d.ts +25 -0
  96. package/lib/typescript/src/types/CPMAdResponse.d.ts.map +1 -0
  97. package/lib/typescript/src/types/FixedAdResponse.d.ts +50 -0
  98. package/lib/typescript/src/types/FixedAdResponse.d.ts.map +1 -0
  99. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts +24 -0
  100. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts.map +1 -0
  101. package/lib/typescript/src/types/Provider.d.ts +16 -0
  102. package/lib/typescript/src/types/Provider.d.ts.map +1 -0
  103. package/package.json +8 -3
  104. package/react-native.config.js +1 -1
  105. package/src/cdpclient/index.ts +1 -21
  106. package/src/components/HTML5AdView.tsx +161 -0
  107. package/src/components/{BannerAd.tsx → deprecated/BannerAdView.tsx} +80 -115
  108. package/src/components/{ConsentModal.tsx → deprecated/ConsentModal.tsx} +2 -2
  109. package/src/constants.ts +8 -0
  110. package/src/index.tsx +4 -2
  111. package/src/{components → providers}/AdgeistProvider.tsx +26 -60
  112. package/src/specs/HTML5AdNativeComponent.ts +46 -0
  113. package/src/{NativeAdgeist.ts → specs/NativeAdgeist.ts} +26 -25
  114. package/src/types/AdSize.ts +4 -0
  115. package/src/types/CPMAdResponse.ts +26 -0
  116. package/src/types/FixedAdResponse.ts +51 -0
  117. package/src/types/HTML5AdNativeComponentProps.ts +28 -0
  118. package/src/types/Provider.ts +16 -0
  119. package/android/src/main/AndroidManifestNew.xml +0 -2
  120. package/android/src/main/java/com/adgeist/implementation/AdgeistModuleImpl.kt +0 -252
  121. package/android/src/newarch/java/com/AdgeistModule.kt +0 -135
  122. package/android/src/oldarch/java/com/AdgeistModule.kt +0 -148
  123. package/ios/adgeist-Bridging-Header.h +0 -1
  124. package/lib/module/NativeAdgeist.js.map +0 -1
  125. package/lib/module/components/AdgeistProvider.js.map +0 -1
  126. package/lib/module/components/BannerAd.js.map +0 -1
  127. package/lib/module/components/ConsentModal.js.map +0 -1
  128. package/lib/typescript/src/NativeAdgeist.d.ts +0 -28
  129. package/lib/typescript/src/NativeAdgeist.d.ts.map +0 -1
  130. package/lib/typescript/src/components/AdgeistProvider.d.ts +0 -50
  131. package/lib/typescript/src/components/AdgeistProvider.d.ts.map +0 -1
  132. package/lib/typescript/src/components/BannerAd.d.ts +0 -64
  133. package/lib/typescript/src/components/BannerAd.d.ts.map +0 -1
  134. package/lib/typescript/src/components/ConsentModal.d.ts.map +0 -1
  135. /package/lib/module/{NativeAdgeist.js → specs/NativeAdgeist.js} +0 -0
  136. /package/lib/typescript/src/components/{ConsentModal.d.ts → deprecated/ConsentModal.d.ts} +0 -0
@@ -35,11 +35,15 @@ public abstract class NativeAdgeistSpec extends ReactContextBaseJavaModule imple
35
35
 
36
36
  @ReactMethod
37
37
  @DoNotStrip
38
- public abstract void initializeSdk(String customDomain, Promise promise);
38
+ public abstract void initializeSdk(String customBidRequestBackendDomain, String customPackageOrBundleID, String customAdgeistAppID, Promise promise);
39
39
 
40
40
  @ReactMethod
41
41
  @DoNotStrip
42
- public abstract void fetchCreative(String apiKey, String origin, String adSpaceId, String publisherId, boolean isTestEnvironment, Promise promise);
42
+ public abstract void destroySdk(Promise promise);
43
+
44
+ @ReactMethod
45
+ @DoNotStrip
46
+ public abstract void fetchCreative(String adSpaceId, String buyType, boolean isTestEnvironment, Promise promise);
43
47
 
44
48
  @ReactMethod
45
49
  @DoNotStrip
@@ -59,25 +63,21 @@ public abstract class NativeAdgeistSpec extends ReactContextBaseJavaModule imple
59
63
 
60
64
  @ReactMethod
61
65
  @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);
66
+ public abstract void trackImpression(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double renderTime, Promise promise);
67
67
 
68
68
  @ReactMethod
69
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);
70
+ public abstract void trackView(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double viewTime, double visibilityRatio, double scrollDepth, double timeToVisible, Promise promise);
71
71
 
72
72
  @ReactMethod
73
73
  @DoNotStrip
74
- public abstract void trackClick(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, Promise promise);
74
+ public abstract void trackTotalView(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalViewTime, Promise promise);
75
75
 
76
76
  @ReactMethod
77
77
  @DoNotStrip
78
- public abstract void trackVideoPlayback(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, double totalPlaybackTime, Promise promise);
78
+ public abstract void trackClick(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, Promise promise);
79
79
 
80
80
  @ReactMethod
81
81
  @DoNotStrip
82
- public abstract void trackVideoQuartile(String campaignId, String adSpaceId, String publisherId, String apiKey, String bidId, boolean isTestEnvironment, String quartile, Promise promise);
82
+ public abstract void trackVideoPlayback(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalPlaybackTime, Promise promise);
83
83
  }
@@ -0,0 +1,55 @@
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: GeneratePropsJavaDelegate.js
8
+ */
9
+
10
+ package com.facebook.react.viewmanagers;
11
+
12
+ import android.view.View;
13
+ import androidx.annotation.Nullable;
14
+ import com.facebook.react.bridge.ReadableArray;
15
+ import com.facebook.react.bridge.ReadableMap;
16
+ import com.facebook.react.uimanager.BaseViewManager;
17
+ import com.facebook.react.uimanager.BaseViewManagerDelegate;
18
+ import com.facebook.react.uimanager.LayoutShadowNode;
19
+
20
+ public class HTML5AdNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & HTML5AdNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
21
+ public HTML5AdNativeComponentManagerDelegate(U viewManager) {
22
+ super(viewManager);
23
+ }
24
+ @Override
25
+ public void setProperty(T view, String propName, @Nullable Object value) {
26
+ switch (propName) {
27
+ case "adUnitID":
28
+ mViewManager.setAdUnitID(view, value == null ? null : (String) value);
29
+ break;
30
+ case "adIsResponsive":
31
+ mViewManager.setAdIsResponsive(view, value == null ? false : (boolean) value);
32
+ break;
33
+ case "adSize":
34
+ mViewManager.setAdSize(view, (ReadableMap) value);
35
+ break;
36
+ case "adType":
37
+ mViewManager.setAdType(view, value == null ? null : (String) value);
38
+ break;
39
+ default:
40
+ super.setProperty(view, propName, value);
41
+ }
42
+ }
43
+
44
+ @Override
45
+ public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
46
+ switch (commandName) {
47
+ case "loadAd":
48
+ mViewManager.loadAd(view, args.getBoolean(0));
49
+ break;
50
+ case "destroy":
51
+ mViewManager.destroy(view);
52
+ break;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,24 @@
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: GeneratePropsJavaInterface.js
8
+ */
9
+
10
+ package com.facebook.react.viewmanagers;
11
+
12
+ import android.view.View;
13
+ import androidx.annotation.Nullable;
14
+ import com.facebook.react.bridge.ReadableMap;
15
+ import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
16
+
17
+ public interface HTML5AdNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
18
+ void setAdUnitID(T view, @Nullable String value);
19
+ void setAdIsResponsive(T view, boolean value);
20
+ void setAdSize(T view, @Nullable ReadableMap value);
21
+ void setAdType(T view, @Nullable String value);
22
+ void loadAd(T view, boolean isTestMode);
23
+ void destroy(T view);
24
+ }
@@ -14,12 +14,17 @@ namespace facebook::react {
14
14
 
15
15
  static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_initializeSdk(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
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);
17
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initializeSdk", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
+ }
19
+
20
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_destroySdk(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, "destroySdk", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
23
  }
19
24
 
20
25
  static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_fetchCreative(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
26
  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);
27
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "fetchCreative", "(Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
28
  }
24
29
 
25
30
  static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_setUserDetails(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
@@ -54,7 +59,7 @@ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackView(facebo
54
59
 
55
60
  static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackTotalView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
56
61
  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);
62
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "trackTotalView", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
58
63
  }
59
64
 
60
65
  static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackClick(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
@@ -67,25 +72,20 @@ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayba
67
72
  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
73
  }
69
74
 
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
75
  NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params)
76
76
  : JavaTurboModule(params) {
77
- methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_initializeSdk};
78
- methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
77
+ methodMap_["initializeSdk"] = MethodMetadata {3, __hostFunction_NativeAdgeistSpecJSI_initializeSdk};
78
+ methodMap_["destroySdk"] = MethodMetadata {0, __hostFunction_NativeAdgeistSpecJSI_destroySdk};
79
+ methodMap_["fetchCreative"] = MethodMetadata {3, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
79
80
  methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_setUserDetails};
80
81
  methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_logEvent};
81
82
  methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistSpecJSI_getConsentStatus};
82
83
  methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus};
83
84
  methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackImpression};
84
85
  methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistSpecJSI_trackView};
85
- methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistSpecJSI_trackTotalView};
86
+ methodMap_["trackTotalView"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackTotalView};
86
87
  methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistSpecJSI_trackClick};
87
88
  methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback};
88
- methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoQuartile};
89
89
  }
90
90
 
91
91
  std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
@@ -0,0 +1,22 @@
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: GenerateComponentDescriptorCpp.js
9
+ */
10
+
11
+ #include "ComponentDescriptors.h"
12
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
13
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
14
+
15
+ namespace facebook::react {
16
+
17
+ void RNAdgeistSpec_registerComponentDescriptorsFromCodegen(
18
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
19
+ registry->add(concreteComponentDescriptorProvider<HTML5AdNativeComponentComponentDescriptor>());
20
+ }
21
+
22
+ } // namespace facebook::react
@@ -0,0 +1,24 @@
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: GenerateComponentDescriptorH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "ShadowNodes.h"
14
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
+
17
+ namespace facebook::react {
18
+
19
+ using HTML5AdNativeComponentComponentDescriptor = ConcreteComponentDescriptor<HTML5AdNativeComponentShadowNode>;
20
+
21
+ void RNAdgeistSpec_registerComponentDescriptorsFromCodegen(
22
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
+
24
+ } // namespace facebook::react
@@ -0,0 +1,60 @@
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: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include "EventEmitters.h"
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+ void HTML5AdNativeComponentEventEmitter::onAdLoaded(OnAdLoaded $event) const {
17
+ dispatchEvent("adLoaded", [](jsi::Runtime &runtime) {
18
+ auto $payload = jsi::Object(runtime);
19
+
20
+ return $payload;
21
+ });
22
+ }
23
+
24
+
25
+ void HTML5AdNativeComponentEventEmitter::onAdFailedToLoad(OnAdFailedToLoad $event) const {
26
+ dispatchEvent("adFailedToLoad", [$event=std::move($event)](jsi::Runtime &runtime) {
27
+ auto $payload = jsi::Object(runtime);
28
+ $payload.setProperty(runtime, "error", $event.error);
29
+ return $payload;
30
+ });
31
+ }
32
+
33
+
34
+ void HTML5AdNativeComponentEventEmitter::onAdOpened(OnAdOpened $event) const {
35
+ dispatchEvent("adOpened", [](jsi::Runtime &runtime) {
36
+ auto $payload = jsi::Object(runtime);
37
+
38
+ return $payload;
39
+ });
40
+ }
41
+
42
+
43
+ void HTML5AdNativeComponentEventEmitter::onAdClosed(OnAdClosed $event) const {
44
+ dispatchEvent("adClosed", [](jsi::Runtime &runtime) {
45
+ auto $payload = jsi::Object(runtime);
46
+
47
+ return $payload;
48
+ });
49
+ }
50
+
51
+
52
+ void HTML5AdNativeComponentEventEmitter::onAdClicked(OnAdClicked $event) const {
53
+ dispatchEvent("adClicked", [](jsi::Runtime &runtime) {
54
+ auto $payload = jsi::Object(runtime);
55
+
56
+ return $payload;
57
+ });
58
+ }
59
+
60
+ } // namespace facebook::react
@@ -0,0 +1,49 @@
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: GenerateEventEmitterH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewEventEmitter.h>
13
+
14
+
15
+ namespace facebook::react {
16
+ class HTML5AdNativeComponentEventEmitter : public ViewEventEmitter {
17
+ public:
18
+ using ViewEventEmitter::ViewEventEmitter;
19
+
20
+ struct OnAdLoaded {
21
+
22
+ };
23
+
24
+ struct OnAdFailedToLoad {
25
+ std::string error;
26
+ };
27
+
28
+ struct OnAdOpened {
29
+
30
+ };
31
+
32
+ struct OnAdClosed {
33
+
34
+ };
35
+
36
+ struct OnAdClicked {
37
+
38
+ };
39
+ void onAdLoaded(OnAdLoaded value) const;
40
+
41
+ void onAdFailedToLoad(OnAdFailedToLoad value) const;
42
+
43
+ void onAdOpened(OnAdOpened value) const;
44
+
45
+ void onAdClosed(OnAdClosed value) const;
46
+
47
+ void onAdClicked(OnAdClicked value) const;
48
+ };
49
+ } // namespace facebook::react
@@ -0,0 +1,28 @@
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: GeneratePropsCpp.js
9
+ */
10
+
11
+ #include "Props.h"
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/propsConversions.h>
14
+
15
+ namespace facebook::react {
16
+
17
+ HTML5AdNativeComponentProps::HTML5AdNativeComponentProps(
18
+ const PropsParserContext &context,
19
+ const HTML5AdNativeComponentProps &sourceProps,
20
+ const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
21
+
22
+ adUnitID(convertRawProp(context, rawProps, "adUnitID", sourceProps.adUnitID, {})),
23
+ adIsResponsive(convertRawProp(context, rawProps, "adIsResponsive", sourceProps.adIsResponsive, {false})),
24
+ adSize(convertRawProp(context, rawProps, "adSize", sourceProps.adSize, {})),
25
+ adType(convertRawProp(context, rawProps, "adType", sourceProps.adType, {}))
26
+ {}
27
+
28
+ } // namespace facebook::react
@@ -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
@@ -14,7 +14,14 @@ namespace facebook::react {
14
14
  static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
15
  return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->initializeSdk(
16
16
  rt,
17
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
17
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
18
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
19
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
20
+ );
21
+ }
22
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_destroySdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
23
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->destroySdk(
24
+ rt
18
25
  );
19
26
  }
20
27
  static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
@@ -22,9 +29,7 @@ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runt
22
29
  rt,
23
30
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
24
31
  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()
32
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool()
28
33
  );
29
34
  }
30
35
  static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
@@ -89,8 +94,7 @@ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView(jsi::Run
89
94
  count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
90
95
  count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
91
96
  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()
97
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
94
98
  );
95
99
  }
96
100
  static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackClick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
@@ -116,33 +120,21 @@ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback(jsi:
116
120
  count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
117
121
  );
118
122
  }
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
123
 
132
124
  NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
133
125
  : TurboModule("Adgeist", jsInvoker) {
134
- methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
135
- methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
126
+ methodMap_["initializeSdk"] = MethodMetadata {3, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
127
+ methodMap_["destroySdk"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_destroySdk};
128
+ methodMap_["fetchCreative"] = MethodMetadata {3, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
136
129
  methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails};
137
130
  methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_logEvent};
138
131
  methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus};
139
132
  methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus};
140
133
  methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression};
141
134
  methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistCxxSpecJSI_trackView};
142
- methodMap_["trackTotalView"] = MethodMetadata {8, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
135
+ methodMap_["trackTotalView"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
143
136
  methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistCxxSpecJSI_trackClick};
144
137
  methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback};
145
- methodMap_["trackVideoQuartile"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoQuartile};
146
138
  }
147
139
 
148
140