@thealteroffice/react-native-adgeist 0.0.24-beta → 0.0.26-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 (30) hide show
  1. package/Adgeist.podspec +1 -1
  2. package/README.md +6 -2
  3. package/android/build.gradle +1 -1
  4. package/android/src/oldarch/java/com/HTML5AdViewManager.kt +4 -4
  5. package/package.json +1 -1
  6. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAdgeistSpec.java +0 -83
  7. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +0 -55
  8. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +0 -24
  9. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  10. package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec-generated.cpp +0 -98
  11. package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec.h +0 -31
  12. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +0 -22
  13. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +0 -24
  14. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +0 -60
  15. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +0 -49
  16. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +0 -28
  17. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.h +0 -52
  18. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +0 -141
  19. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +0 -170
  20. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +0 -17
  21. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +0 -32
  22. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.cpp +0 -16
  23. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.h +0 -29
  24. package/plugin/build/android/withRNAdgeistMainApplication.d.ts +0 -3
  25. package/plugin/build/android/withRNAdgeistMainApplication.js +0 -65
  26. package/plugin/build/index.d.ts +0 -3
  27. package/plugin/build/index.js +0 -25
  28. package/plugin/build/ios/withRNAdgeistAppDelegate.d.ts +0 -4
  29. package/plugin/build/ios/withRNAdgeistAppDelegate.js +0 -66
  30. /package/ios/{Adgeist-Bridging-Header.h → adgeist-Bridging-Header.h} +0 -0
package/Adgeist.podspec CHANGED
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.private_header_files = "ios/**/*.h"
18
18
 
19
- s.dependency "AdgeistKit", '= 1.0.2-beta'
19
+ s.dependency "AdgeistKit", '= 1.0.5-beta'
20
20
 
21
21
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
22
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
package/README.md CHANGED
@@ -29,6 +29,8 @@ npm install @thealteroffice/react-native-adgeist
29
29
  yarn add @thealteroffice/react-native-adgeist
30
30
  ```
31
31
 
32
+ ### STEP 2: Update Configuration for Android and iOS
33
+
32
34
  ### Android Configuration
33
35
 
34
36
  Add your Adgeist publisher ID, api key and package id, as identified in the Adgeist web interface, to your app's `AndroidManifest.xml` file. To do so, add a `<meta-data>` tag with `android:name="com.adgeistkit.ads.ADGEIST_APP_ID"` and `android:name="com.adgeistkit.ads.ADGEIST_API_KEY"`
@@ -81,7 +83,9 @@ A `ADGEIST_APP_ID` and `ADGEIST_API_KEY` key with a string value of your Adgeist
81
83
  <string>69326f9fbb280f9241cabc94</string>
82
84
  ```
83
85
 
84
- ## Perform the Configuration of AdgeistProvider
86
+ ### STEP 3: React Native Configuration and Ad Placement
87
+
88
+ ### Configure AdgeistProvider
85
89
 
86
90
  Add an `AdgeistProvider` at the root level of your app.
87
91
 
@@ -97,7 +101,7 @@ export default function App() {
97
101
  }
98
102
  ```
99
103
 
100
- ## Implement the Embedding of Ad Slots
104
+ ### Implement Ad Placement
101
105
 
102
106
  Use the `HTML5AdView` component to display banner ads anywhere in your app. Place this component where you want the ads to appear and the SDK will automatically load and render the ad content.
103
107
 
@@ -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.11-beta"
107
+ implementation "ai.adgeist:adgeistkit:1.1.12-beta"
108
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
109
109
  }
110
110
 
@@ -1,5 +1,6 @@
1
1
  package com.adgeist.components
2
2
 
3
+ import androidx.annotation.RequiresPermission
3
4
  import com.adgeistkit.ads.AdView
4
5
  import com.facebook.react.bridge.ReadableMap
5
6
  import com.facebook.react.common.MapBuilder
@@ -25,7 +26,7 @@ class HTML5AdViewManager : SimpleViewManager<AdView>() {
25
26
  fun setAdIsResponsive(view: AdView, adIsResponsive: Boolean) {
26
27
  HTML5AdViewManagerImpl.setAdIsResponsive(view, adIsResponsive)
27
28
  }
28
-
29
+
29
30
  @ReactProp(name = "adSize")
30
31
  fun setAdSize(view: AdView, adSizeMap: ReadableMap?) {
31
32
  HTML5AdViewManagerImpl.setAdSize(view, adSizeMap)
@@ -47,12 +48,11 @@ class HTML5AdViewManager : SimpleViewManager<AdView>() {
47
48
  }
48
49
 
49
50
  @RequiresPermission("android.permission.INTERNET")
50
- fun loadAd(view: AdView, args: ReadableArray?) {
51
- val isTestMode = if (args != null && args.size() > 0) args.getBoolean(0) else false
51
+ fun loadAd(view: AdView, isTestMode: Boolean) {
52
52
  HTML5AdViewManagerImpl.loadAd(view, isTestMode)
53
53
  }
54
54
 
55
- override fun destroy(view: AdView) {
55
+ fun destroy(view: AdView) {
56
56
  HTML5AdViewManagerImpl.destroyAd(view)
57
57
  }
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thealteroffice/react-native-adgeist",
3
- "version": "0.0.24-beta",
3
+ "version": "0.0.26-beta",
4
4
  "description": "Publishers can integrate our SDK to connect their ad spaces to the AdGeist marketplace.",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -1,83 +0,0 @@
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.facebook.fbreact.specs;
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 customBidRequestBackendDomain, String customPackageOrBundleID, String customAdgeistAppID, Promise promise);
39
-
40
- @ReactMethod
41
- @DoNotStrip
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);
47
-
48
- @ReactMethod
49
- @DoNotStrip
50
- public abstract void setUserDetails(ReadableMap user);
51
-
52
- @ReactMethod
53
- @DoNotStrip
54
- public abstract void logEvent(ReadableMap event);
55
-
56
- @ReactMethod
57
- @DoNotStrip
58
- public abstract void getConsentStatus(Promise promise);
59
-
60
- @ReactMethod
61
- @DoNotStrip
62
- public abstract void updateConsentStatus(boolean consent);
63
-
64
- @ReactMethod
65
- @DoNotStrip
66
- public abstract void trackImpression(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double renderTime, Promise promise);
67
-
68
- @ReactMethod
69
- @DoNotStrip
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
-
72
- @ReactMethod
73
- @DoNotStrip
74
- public abstract void trackTotalView(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalViewTime, Promise promise);
75
-
76
- @ReactMethod
77
- @DoNotStrip
78
- public abstract void trackClick(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, Promise promise);
79
-
80
- @ReactMethod
81
- @DoNotStrip
82
- public abstract void trackVideoPlayback(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalPlaybackTime, Promise promise);
83
- }
@@ -1,55 +0,0 @@
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
- }
@@ -1,24 +0,0 @@
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
- }
@@ -1,36 +0,0 @@
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
- )
@@ -1,98 +0,0 @@
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;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);
23
- }
24
-
25
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_fetchCreative(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, PromiseKind, "fetchCreative", "(Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
- }
29
-
30
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_setUserDetails(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, "setUserDetails", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
33
- }
34
-
35
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_logEvent(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, VoidKind, "logEvent", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
38
- }
39
-
40
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_getConsentStatus(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, PromiseKind, "getConsentStatus", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
43
- }
44
-
45
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus(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, VoidKind, "updateConsentStatus", "(Z)V", args, count, cachedMethodId);
48
- }
49
-
50
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackImpression(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, "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);
53
- }
54
-
55
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackView(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, "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);
58
- }
59
-
60
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackTotalView(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, "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);
63
- }
64
-
65
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackClick(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, "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);
68
- }
69
-
70
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback(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, "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);
73
- }
74
-
75
- NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params)
76
- : JavaTurboModule(params) {
77
- methodMap_["initializeSdk"] = MethodMetadata {3, __hostFunction_NativeAdgeistSpecJSI_initializeSdk};
78
- methodMap_["destroySdk"] = MethodMetadata {0, __hostFunction_NativeAdgeistSpecJSI_destroySdk};
79
- methodMap_["fetchCreative"] = MethodMetadata {3, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
80
- methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_setUserDetails};
81
- methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_logEvent};
82
- methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistSpecJSI_getConsentStatus};
83
- methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_updateConsentStatus};
84
- methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackImpression};
85
- methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistSpecJSI_trackView};
86
- methodMap_["trackTotalView"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackTotalView};
87
- methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistSpecJSI_trackClick};
88
- methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistSpecJSI_trackVideoPlayback};
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
@@ -1,31 +0,0 @@
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
@@ -1,22 +0,0 @@
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 <react/renderer/components/RNAdgeistSpec/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
@@ -1,24 +0,0 @@
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 <react/renderer/components/RNAdgeistSpec/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
@@ -1,60 +0,0 @@
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 <react/renderer/components/RNAdgeistSpec/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
@@ -1,49 +0,0 @@
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
@@ -1,28 +0,0 @@
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 <react/renderer/components/RNAdgeistSpec/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
@@ -1,52 +0,0 @@
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
@@ -1,141 +0,0 @@
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
- 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
25
- );
26
- }
27
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
28
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
29
- rt,
30
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
31
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
32
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool()
33
- );
34
- }
35
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
- static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->setUserDetails(
37
- rt,
38
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
39
- );
40
- return jsi::Value::undefined();
41
- }
42
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_logEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
43
- static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->logEvent(
44
- rt,
45
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
46
- );
47
- return jsi::Value::undefined();
48
- }
49
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
50
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->getConsentStatus(
51
- rt
52
- );
53
- }
54
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
55
- static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->updateConsentStatus(
56
- rt,
57
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
58
- );
59
- return jsi::Value::undefined();
60
- }
61
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
62
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackImpression(
63
- rt,
64
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
65
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
66
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
67
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
68
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
69
- count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
70
- count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
71
- );
72
- }
73
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
74
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackView(
75
- rt,
76
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
77
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
78
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
79
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
80
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
81
- count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
82
- count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
83
- count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(),
84
- count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asNumber(),
85
- count <= 9 ? throw jsi::JSError(rt, "Expected argument in position 9 to be passed") : args[9].asNumber()
86
- );
87
- }
88
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
89
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackTotalView(
90
- rt,
91
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
92
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
93
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
94
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
95
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
96
- count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
97
- count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
98
- );
99
- }
100
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackClick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
101
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackClick(
102
- rt,
103
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
104
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
105
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
106
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
107
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
108
- count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool()
109
- );
110
- }
111
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
112
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->trackVideoPlayback(
113
- rt,
114
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
115
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
116
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
117
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
118
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
119
- count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asBool(),
120
- count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber()
121
- );
122
- }
123
-
124
- NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
125
- : TurboModule("Adgeist", jsInvoker) {
126
- methodMap_["initializeSdk"] = MethodMetadata {3, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
127
- methodMap_["destroySdk"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_destroySdk};
128
- methodMap_["fetchCreative"] = MethodMetadata {3, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
129
- methodMap_["setUserDetails"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_setUserDetails};
130
- methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_logEvent};
131
- methodMap_["getConsentStatus"] = MethodMetadata {0, __hostFunction_NativeAdgeistCxxSpecJSI_getConsentStatus};
132
- methodMap_["updateConsentStatus"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_updateConsentStatus};
133
- methodMap_["trackImpression"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackImpression};
134
- methodMap_["trackView"] = MethodMetadata {10, __hostFunction_NativeAdgeistCxxSpecJSI_trackView};
135
- methodMap_["trackTotalView"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackTotalView};
136
- methodMap_["trackClick"] = MethodMetadata {6, __hostFunction_NativeAdgeistCxxSpecJSI_trackClick};
137
- methodMap_["trackVideoPlayback"] = MethodMetadata {7, __hostFunction_NativeAdgeistCxxSpecJSI_trackVideoPlayback};
138
- }
139
-
140
-
141
- } // namespace facebook::react
@@ -1,170 +0,0 @@
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 customBidRequestBackendDomain, jsi::String customPackageOrBundleID, jsi::String customAdgeistAppID) = 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, jsi::String customBidRequestBackendDomain, jsi::String customPackageOrBundleID, jsi::String customAdgeistAppID) override {
66
- static_assert(
67
- bridging::getParameterCount(&T::initializeSdk) == 4,
68
- "Expected initializeSdk(...) to have 4 parameters");
69
-
70
- return bridging::callFromJs<jsi::Value>(
71
- rt, &T::initializeSdk, jsInvoker_, instance_, std::move(customBidRequestBackendDomain), std::move(customPackageOrBundleID), std::move(customAdgeistAppID));
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
@@ -1,17 +0,0 @@
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
@@ -1,32 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,29 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export declare const withRNAdgeistMainApplication: ConfigPlugin;
3
- export declare function ktFileUpdater(originalContents: string): string;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withRNAdgeistMainApplication = void 0;
4
- exports.ktFileUpdater = ktFileUpdater;
5
- const config_plugins_1 = require("@expo/config-plugins");
6
- const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
7
- const withRNAdgeistMainApplication = (config) => {
8
- return (0, config_plugins_1.withAppBuildGradle)((0, config_plugins_1.withMainApplication)(config, readMainApplicationFileAndUpdateContents), readBuildGradleFileAndUpdateContents);
9
- };
10
- exports.withRNAdgeistMainApplication = withRNAdgeistMainApplication;
11
- // 1. MainActivity Modifications
12
- async function readMainApplicationFileAndUpdateContents(config) {
13
- const { modResults: mainApplicationFile } = config;
14
- const worker = getCompatibleFileUpdater(mainApplicationFile.language);
15
- mainApplicationFile.contents = worker(mainApplicationFile.contents);
16
- return config;
17
- }
18
- function readBuildGradleFileAndUpdateContents(config) {
19
- const { modResults } = config;
20
- if (!modResults.contents.includes('implementation "ai.adgeist:adgeistkit:')) {
21
- modResults.contents = modResults.contents.replace(/dependencies\s*{/, `dependencies {
22
- implementation "ai.adgeist:adgeistkit:0.0.1" // AdgeistKit Dependency`);
23
- }
24
- return config;
25
- }
26
- function getCompatibleFileUpdater(language) {
27
- switch (language) {
28
- case 'kt':
29
- return ktFileUpdater;
30
- default:
31
- throw new Error(`Cannot add React Native Orientation Director code to MainActivity of language "${language}"`);
32
- }
33
- }
34
- function ktFileUpdater(originalContents) {
35
- // Safer anchor detection
36
- const anchors = [
37
- /super\.onCreate\(/,
38
- /@Override\s+fun onCreate\(/,
39
- /class \w+ : ReactActivity/,
40
- ].find((anchor) => anchor.test(originalContents));
41
- if (!anchors) {
42
- throw new Error('Could not find suitable insertion point in MainActivity');
43
- }
44
- const packageImportCodeBlock = 'import com.adgeist.AdgeistPackage';
45
- const rightBeforeClassDeclaration = /import com.facebook.react.ReactPackage/;
46
- const importMergeResults = (0, generateCode_1.mergeContents)({
47
- tag: '@react-native-adgeist/package-import',
48
- src: originalContents,
49
- newSrc: packageImportCodeBlock,
50
- anchor: rightBeforeClassDeclaration,
51
- offset: 0,
52
- comment: '// React Native Adgeist',
53
- });
54
- const onConfigurationChangedCodeBlock = `packages.add(AdgeistPackage())`;
55
- const rightBeforeOnReturnStatement = /return packages/;
56
- const implementationMergeResults = (0, generateCode_1.mergeContents)({
57
- tag: '@react-native-adgeist/package-initialization',
58
- src: importMergeResults.contents,
59
- newSrc: onConfigurationChangedCodeBlock,
60
- anchor: rightBeforeOnReturnStatement,
61
- offset: 0,
62
- comment: '// Package Initialization',
63
- });
64
- return implementationMergeResults.contents;
65
- }
@@ -1,3 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- declare const _default: ConfigPlugin<void>;
3
- export default _default;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_plugins_1 = require("@expo/config-plugins");
4
- const withRNAdgeistMainApplication_1 = require("./android/withRNAdgeistMainApplication");
5
- const withRNAdgeistAppDelegate_1 = require("./ios/withRNAdgeistAppDelegate");
6
- /**
7
- * So, expo config plugin are awesome and the documentation is well written, but I still needed to look around to see
8
- * how other projects actually modify the AppDelegate. I've found react-native-firebase to implement a plugin config
9
- * that changes the AppDelegate, so I'll leave their link as reference:
10
- * https://github.com/invertase/react-native-firebase/blob/main/packages/app/plugin/src/ios/appDelegate.ts
11
- *
12
- * Kudos to them, because this stuff is hard!
13
- *
14
- * @param config
15
- */
16
- const withRNAdgeist = (config) => {
17
- return (0, config_plugins_1.withPlugins)(config, [
18
- //Android
19
- withRNAdgeistMainApplication_1.withRNAdgeistMainApplication,
20
- //iOS
21
- withRNAdgeistAppDelegate_1.withRNAdgeistAppDelegate,
22
- ]);
23
- };
24
- const pak = require('@thealteroffice/react-native-adgeist/package.json');
25
- exports.default = (0, config_plugins_1.createRunOncePlugin)(withRNAdgeist, pak.name, pak.version);
@@ -1,4 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export declare const withRNAdgeistAppDelegate: ConfigPlugin;
3
- export declare function swiftFileUpdater(originalContents: string): string;
4
- export declare function objCFileUpdater(originalContents: string): string;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withRNAdgeistAppDelegate = void 0;
4
- exports.swiftFileUpdater = swiftFileUpdater;
5
- exports.objCFileUpdater = objCFileUpdater;
6
- const config_plugins_1 = require("@expo/config-plugins");
7
- const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
8
- const withRNAdgeistAppDelegate = (config) => {
9
- return (0, config_plugins_1.withAppDelegate)(config, readAppDelegateFileAndUpdateContents);
10
- };
11
- exports.withRNAdgeistAppDelegate = withRNAdgeistAppDelegate;
12
- async function readAppDelegateFileAndUpdateContents(config) {
13
- const { modResults: appDelegateFile } = config;
14
- const worker = getCompatibleFileUpdater(appDelegateFile.language);
15
- appDelegateFile.contents = worker(appDelegateFile.contents);
16
- return config;
17
- }
18
- function getCompatibleFileUpdater(language) {
19
- switch (language) {
20
- case 'objc':
21
- case 'objcpp': {
22
- return objCFileUpdater;
23
- }
24
- case 'swift':
25
- return swiftFileUpdater;
26
- default:
27
- throw new Error(`Cannot add React Native Adgeist code to AppDelegate of language "${language}"`);
28
- }
29
- }
30
- function swiftFileUpdater(originalContents) {
31
- const wantsToAddAnyCodeBlock = ``;
32
- const rightBeforeLastClosingBrace = /didFinishLaunchingWithOptions:\s*launchOptions\)/g;
33
- const pasteInTheListJustAfterTheClosingBracket = 2;
34
- const results = (0, generateCode_1.mergeContents)({
35
- tag: '@react-native-adgeist/implementation',
36
- src: originalContents,
37
- newSrc: wantsToAddAnyCodeBlock,
38
- anchor: rightBeforeLastClosingBrace,
39
- offset: pasteInTheListJustAfterTheClosingBracket,
40
- comment: '// React Native Ageist',
41
- });
42
- return results.contents;
43
- }
44
- function objCFileUpdater(originalContents) {
45
- const libraryHeaderImportCodeBlock = '#import "Adgeist.h"\n';
46
- const rightBeforeAppDelegateImplementation = /@implementation\s+\w+/g;
47
- const headerImportMergeResults = (0, generateCode_1.mergeContents)({
48
- tag: '@react-native-adgeist/library-header-import',
49
- src: originalContents,
50
- newSrc: libraryHeaderImportCodeBlock,
51
- anchor: rightBeforeAppDelegateImplementation,
52
- offset: 0,
53
- comment: '// React Native Ageist',
54
- });
55
- const wantsToAddAnyCodeBlock = ``;
56
- const rightBeforeLastClosingEnd = /@end[^@]*$/g;
57
- const implementationMergeResults = (0, generateCode_1.mergeContents)({
58
- tag: '@react-native-adgeist/implementation',
59
- src: headerImportMergeResults.contents,
60
- newSrc: wantsToAddAnyCodeBlock,
61
- anchor: rightBeforeLastClosingEnd,
62
- offset: 0,
63
- comment: '// React Native Ageist',
64
- });
65
- return implementationMergeResults.contents;
66
- }