@thealteroffice/react-native-adgeist 0.0.26-beta → 0.0.27-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.
- package/Adgeist.podspec +1 -1
- package/README.md +4 -11
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAdgeistSpec.java +84 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +55 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +24 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec-generated.cpp +98 -0
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec.h +31 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +60 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +49 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +28 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/Props.h +52 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +142 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +170 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.cpp +16 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/States.h +29 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +11 -5
- package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +2 -2
- package/android/src/newarch/java/com/Adgeist.kt +2 -3
- package/android/src/newarch/java/com/HTML5AdViewManager.kt +2 -5
- package/android/src/oldarch/java/com/Adgeist.kt +2 -2
- package/android/src/oldarch/java/com/HTML5AdViewManager.kt +33 -0
- package/ios/Adgeist.mm +2 -0
- package/ios/AdgeistImpl.swift +3 -1
- package/lib/module/components/HTML5AdView.js +3 -3
- package/lib/module/components/HTML5AdView.js.map +1 -1
- package/lib/module/constants.js +2 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/providers/AdgeistProvider.js +4 -3
- package/lib/module/providers/AdgeistProvider.js.map +1 -1
- package/lib/module/specs/HTML5AdNativeComponent.ts +30 -0
- package/lib/module/specs/NativeAdgeist.js.map +1 -1
- package/lib/typescript/src/constants.d.ts +2 -0
- package/lib/typescript/src/constants.d.ts.map +1 -1
- package/lib/typescript/src/providers/AdgeistProvider.d.ts.map +1 -1
- package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts +4 -0
- package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeAdgeist.d.ts +1 -1
- package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -1
- package/lib/typescript/src/types/Provider.d.ts +3 -3
- package/lib/typescript/src/types/Provider.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/components/HTML5AdView.tsx +3 -3
- package/src/constants.ts +3 -0
- package/src/providers/AdgeistProvider.tsx +5 -3
- package/src/specs/HTML5AdNativeComponent.ts +30 -0
- package/src/specs/NativeAdgeist.ts +4 -3
- package/src/types/Provider.ts +3 -3
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.
|
|
19
|
+
s.dependency "AdgeistKit", '= 1.0.7-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
|
@@ -14,7 +14,7 @@ To prepare your app, complete the steps in the following sections.
|
|
|
14
14
|
|
|
15
15
|
Make sure that your app's build file uses the following values:
|
|
16
16
|
|
|
17
|
-
- Minimum SDK version of
|
|
17
|
+
- Minimum SDK version of 23 or higher
|
|
18
18
|
- Compile SDK version of 35 or higher
|
|
19
19
|
|
|
20
20
|
## Configure your app
|
|
@@ -33,7 +33,7 @@ yarn add @thealteroffice/react-native-adgeist
|
|
|
33
33
|
|
|
34
34
|
### Android Configuration
|
|
35
35
|
|
|
36
|
-
Add your Adgeist publisher ID
|
|
36
|
+
Add your Adgeist publisher 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"`
|
|
37
37
|
|
|
38
38
|
You can find your app ID in the Adgeist web interface. For `android:value`, insert your own Adgeist publisher ID, surrounded by quotation marks.
|
|
39
39
|
|
|
@@ -41,20 +41,15 @@ You can find your app ID in the Adgeist web interface. For `android:value`, inse
|
|
|
41
41
|
<manifest>
|
|
42
42
|
<application>
|
|
43
43
|
<!-- Sample Adgeist app ID: 69326f9fbb280f9241cabc94 -->
|
|
44
|
-
<!-- Sample Adgeist api key: b4e33bb73061d4e33670f229033f14bf770d35b15512dc1f106529e38946e49c -->
|
|
45
44
|
|
|
46
45
|
<meta-data
|
|
47
46
|
android:name="com.adgeistkit.ads.ADGEIST_APP_ID"
|
|
48
47
|
android:value="ADGEIST_APP_ID"/>
|
|
49
|
-
|
|
50
|
-
<meta-data
|
|
51
|
-
android:name="com.adgeistkit.ads.ADGEIST_API_KEY"
|
|
52
|
-
android:value="ADGEIST_API_KEY"/>
|
|
53
48
|
</application>
|
|
54
49
|
</manifest>
|
|
55
50
|
```
|
|
56
51
|
|
|
57
|
-
Replace `ADGEIST_APP_ID
|
|
52
|
+
Replace `ADGEIST_APP_ID` with your Adgeist Publisher ID.
|
|
58
53
|
|
|
59
54
|
### iOS Configuration
|
|
60
55
|
|
|
@@ -74,11 +69,9 @@ cd ios && pod install --repo-update
|
|
|
74
69
|
|
|
75
70
|
Update your app's `Info.plist` file to add three keys:
|
|
76
71
|
|
|
77
|
-
A `ADGEIST_APP_ID`
|
|
72
|
+
A `ADGEIST_APP_ID` key with a string value of your Adgeist ID found in the Adgeist UI.
|
|
78
73
|
|
|
79
74
|
```xml
|
|
80
|
-
<key>ADGEIST_API_KEY</key>
|
|
81
|
-
<string>e31edf10067897a3904b64b6a4b5f18b1260470183ae203cc521b0479166d597</string>
|
|
82
75
|
<key>ADGEIST_APP_ID</key>
|
|
83
76
|
<string>69326f9fbb280f9241cabc94</string>
|
|
84
77
|
```
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import javax.annotation.Nullable;
|
|
24
|
+
|
|
25
|
+
public abstract class NativeAdgeistSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
26
|
+
public static final String NAME = "Adgeist";
|
|
27
|
+
|
|
28
|
+
public NativeAdgeistSpec(ReactApplicationContext reactContext) {
|
|
29
|
+
super(reactContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
public @Nonnull String getName() {
|
|
34
|
+
return NAME;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@ReactMethod
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
public abstract void initializeSdk(@Nullable String customBidRequestBackendDomain, @Nullable String customPackageOrBundleID, @Nullable String customAdgeistAppID, @Nullable String customVersioning, Promise promise);
|
|
40
|
+
|
|
41
|
+
@ReactMethod
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
public abstract void destroySdk(Promise promise);
|
|
44
|
+
|
|
45
|
+
@ReactMethod
|
|
46
|
+
@DoNotStrip
|
|
47
|
+
public abstract void fetchCreative(String adSpaceId, String buyType, boolean isTestEnvironment, Promise promise);
|
|
48
|
+
|
|
49
|
+
@ReactMethod
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
public abstract void setUserDetails(ReadableMap user);
|
|
52
|
+
|
|
53
|
+
@ReactMethod
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
public abstract void logEvent(ReadableMap event);
|
|
56
|
+
|
|
57
|
+
@ReactMethod
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
public abstract void getConsentStatus(Promise promise);
|
|
60
|
+
|
|
61
|
+
@ReactMethod
|
|
62
|
+
@DoNotStrip
|
|
63
|
+
public abstract void updateConsentStatus(boolean consent);
|
|
64
|
+
|
|
65
|
+
@ReactMethod
|
|
66
|
+
@DoNotStrip
|
|
67
|
+
public abstract void trackImpression(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double renderTime, Promise promise);
|
|
68
|
+
|
|
69
|
+
@ReactMethod
|
|
70
|
+
@DoNotStrip
|
|
71
|
+
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);
|
|
72
|
+
|
|
73
|
+
@ReactMethod
|
|
74
|
+
@DoNotStrip
|
|
75
|
+
public abstract void trackTotalView(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalViewTime, Promise promise);
|
|
76
|
+
|
|
77
|
+
@ReactMethod
|
|
78
|
+
@DoNotStrip
|
|
79
|
+
public abstract void trackClick(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, Promise promise);
|
|
80
|
+
|
|
81
|
+
@ReactMethod
|
|
82
|
+
@DoNotStrip
|
|
83
|
+
public abstract void trackVideoPlayback(String campaignId, String adSpaceId, String bidId, String bidMeta, String buyType, boolean isTestEnvironment, double totalPlaybackTime, Promise promise);
|
|
84
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNAdgeistSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_RNAdgeistSpec
|
|
13
|
+
OBJECT
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_RNAdgeistSpec PUBLIC . react/renderer/components/RNAdgeistSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_RNAdgeistSpec
|
|
21
|
+
fbjni
|
|
22
|
+
jsi
|
|
23
|
+
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
+
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
+
reactnative
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
target_compile_options(
|
|
29
|
+
react_codegen_RNAdgeistSpec
|
|
30
|
+
PRIVATE
|
|
31
|
+
-DLOG_TAG=\"ReactNative\"
|
|
32
|
+
-fexceptions
|
|
33
|
+
-frtti
|
|
34
|
+
-std=c++20
|
|
35
|
+
-Wall
|
|
36
|
+
)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "RNAdgeistSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_initializeSdk(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
+
static jmethodID cachedMethodId = nullptr;
|
|
17
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initializeSdk", "(Ljava/lang/String;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 ¶ms)
|
|
76
|
+
: JavaTurboModule(params) {
|
|
77
|
+
methodMap_["initializeSdk"] = MethodMetadata {4, __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 ¶ms) {
|
|
92
|
+
if (moduleName == "Adgeist") {
|
|
93
|
+
return std::make_shared<NativeAdgeistSpecJSI>(params);
|
|
94
|
+
}
|
|
95
|
+
return nullptr;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
|
15
|
+
#include <jsi/jsi.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* JNI C++ class for module 'NativeAdgeist'
|
|
21
|
+
*/
|
|
22
|
+
class JSI_EXPORT NativeAdgeistSpecJSI : public JavaTurboModule {
|
|
23
|
+
public:
|
|
24
|
+
NativeAdgeistSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
+
|
|
31
|
+
} // namespace facebook::react
|
|
@@ -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 <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
|
|
@@ -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 <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
|
|
@@ -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 <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
|
|
@@ -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 <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
|
|
@@ -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
|