@thealteroffice/react-native-adgeist 0.0.9 → 0.0.10

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/README.md CHANGED
@@ -44,6 +44,47 @@ npx expo prebuild --clean
44
44
 
45
45
  > **Note**: Requires Expo SDK 50+ and Kotlin template support.
46
46
 
47
+ ## ⚙️ Peer Dependencies
48
+
49
+ This package uses `react-native-video` internally for media rendering.
50
+
51
+ ### Why Peer Dependency?
52
+ React Native native modules like `react-native-video` should not be bundled inside libraries to prevent native build conflicts.
53
+
54
+ We declare `react-native-video` as a peer dependency, so your app controls the version.
55
+
56
+ ### What You Need to Do
57
+ - **If your app already uses `react-native-video`**: No action needed.
58
+ - **If your app does not have `react-native-video` installed**: Please install it manually:
59
+
60
+ ```bash
61
+ npm install react-native-video@^4.5.2
62
+ ```
63
+ or
64
+ ```bash
65
+ yarn add react-native-video@^4.5.2
66
+ ```
67
+
68
+ ### What Happens If You Skip This?
69
+ If `react-native-video` is not installed, your app will crash at runtime with:
70
+
71
+ ```javascript
72
+ Error: Cannot find module 'react-native-video'
73
+ ```
74
+
75
+ ### Why Not Include It in dependencies?
76
+ Adding `react-native-video` to dependencies directly in this library would:
77
+
78
+ - ❌ Cause duplicate native module linking
79
+ - ❌ Lead to iOS/Android build failures
80
+ - ❌ Break compatibility with apps already using `react-native-video`
81
+
82
+ ### Dependency Summary
83
+
84
+ | Package | Install It? | Why? |
85
+ |---------|-------------|------|
86
+ | `react-native-video` | ✅ **Yes (required)** | Your app must install this manually to satisfy the peer dependency |
87
+
47
88
  ## 🔧 Setup & Configuration
48
89
 
49
90
  ### Basic Setup
@@ -0,0 +1,46 @@
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.turbomodule.core.interfaces.TurboModule;
21
+ import javax.annotation.Nonnull;
22
+
23
+ public abstract class NativeAdgeistSpec extends ReactContextBaseJavaModule implements TurboModule {
24
+ public static final String NAME = "Adgeist";
25
+
26
+ public NativeAdgeistSpec(ReactApplicationContext reactContext) {
27
+ super(reactContext);
28
+ }
29
+
30
+ @Override
31
+ public @Nonnull String getName() {
32
+ return NAME;
33
+ }
34
+
35
+ @ReactMethod
36
+ @DoNotStrip
37
+ public abstract void initializeSdk(String customDomain, Promise promise);
38
+
39
+ @ReactMethod
40
+ @DoNotStrip
41
+ public abstract void fetchCreative(String apiKey, String origin, String adSpaceId, String publisherId, boolean isTestEnvironment, Promise promise);
42
+
43
+ @ReactMethod
44
+ @DoNotStrip
45
+ public abstract void sendCreativeAnalytic(String campaignId, String adSpaceId, String publisherId, String eventType, String origin, String apiKey, String bidId, boolean isTestEnvironment, Promise promise);
46
+ }
@@ -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,44 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniCpp.js
9
+ */
10
+
11
+ #include "RNAdgeistSpec.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_initializeSdk(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
+ static jmethodID cachedMethodId = nullptr;
17
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initializeSdk", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
+ }
19
+
20
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_fetchCreative(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
+ static jmethodID cachedMethodId = nullptr;
22
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "fetchCreative", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
+ }
24
+
25
+ static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic(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, "sendCreativeAnalytic", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
+ }
29
+
30
+ NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params)
31
+ : JavaTurboModule(params) {
32
+ methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistSpecJSI_initializeSdk};
33
+ methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
34
+ methodMap_["sendCreativeAnalytic"] = MethodMetadata {8, __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic};
35
+ }
36
+
37
+ std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
38
+ if (moduleName == "Adgeist") {
39
+ return std::make_shared<NativeAdgeistSpecJSI>(params);
40
+ }
41
+ return nullptr;
42
+ }
43
+
44
+ } // namespace facebook::react
@@ -0,0 +1,31 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <ReactCommon/JavaTurboModule.h>
14
+ #include <ReactCommon/TurboModule.h>
15
+ #include <jsi/jsi.h>
16
+
17
+ namespace facebook::react {
18
+
19
+ /**
20
+ * JNI C++ class for module 'NativeAdgeist'
21
+ */
22
+ class JSI_EXPORT NativeAdgeistSpecJSI : public JavaTurboModule {
23
+ public:
24
+ NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params);
25
+ };
26
+
27
+
28
+ JSI_EXPORT
29
+ std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
+
31
+ } // namespace facebook::react
@@ -0,0 +1,52 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleCpp.js
8
+ */
9
+
10
+ #include "RNAdgeistSpecJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->initializeSdk(
16
+ rt,
17
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
18
+ );
19
+ }
20
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
21
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
22
+ rt,
23
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
24
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
25
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
26
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
27
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asBool()
28
+ );
29
+ }
30
+ static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
31
+ return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->sendCreativeAnalytic(
32
+ rt,
33
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
34
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
35
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
36
+ count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt),
37
+ count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt),
38
+ count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asString(rt),
39
+ count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asString(rt),
40
+ count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asBool()
41
+ );
42
+ }
43
+
44
+ NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
45
+ : TurboModule("Adgeist", jsInvoker) {
46
+ methodMap_["initializeSdk"] = MethodMetadata {1, __hostFunction_NativeAdgeistCxxSpecJSI_initializeSdk};
47
+ methodMap_["fetchCreative"] = MethodMetadata {5, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
48
+ methodMap_["sendCreativeAnalytic"] = MethodMetadata {8, __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic};
49
+ }
50
+
51
+
52
+ } // namespace facebook::react
@@ -0,0 +1,89 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+ class JSI_EXPORT NativeAdgeistCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual jsi::Value initializeSdk(jsi::Runtime &rt, jsi::String customDomain) = 0;
24
+ virtual jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String apiKey, jsi::String origin, jsi::String adSpaceId, jsi::String publisherId, bool isTestEnvironment) = 0;
25
+ virtual jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType, jsi::String origin, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment) = 0;
26
+
27
+ };
28
+
29
+ template <typename T>
30
+ class JSI_EXPORT NativeAdgeistCxxSpec : public TurboModule {
31
+ public:
32
+ jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
33
+ return delegate_.create(rt, propName);
34
+ }
35
+
36
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
37
+ return delegate_.getPropertyNames(runtime);
38
+ }
39
+
40
+ static constexpr std::string_view kModuleName = "Adgeist";
41
+
42
+ protected:
43
+ NativeAdgeistCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
44
+ : TurboModule(std::string{NativeAdgeistCxxSpec::kModuleName}, jsInvoker),
45
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
46
+
47
+
48
+ private:
49
+ class Delegate : public NativeAdgeistCxxSpecJSI {
50
+ public:
51
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
52
+ NativeAdgeistCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
53
+
54
+ }
55
+
56
+ jsi::Value initializeSdk(jsi::Runtime &rt, jsi::String customDomain) override {
57
+ static_assert(
58
+ bridging::getParameterCount(&T::initializeSdk) == 2,
59
+ "Expected initializeSdk(...) to have 2 parameters");
60
+
61
+ return bridging::callFromJs<jsi::Value>(
62
+ rt, &T::initializeSdk, jsInvoker_, instance_, std::move(customDomain));
63
+ }
64
+ jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String apiKey, jsi::String origin, jsi::String adSpaceId, jsi::String publisherId, bool isTestEnvironment) override {
65
+ static_assert(
66
+ bridging::getParameterCount(&T::fetchCreative) == 6,
67
+ "Expected fetchCreative(...) to have 6 parameters");
68
+
69
+ return bridging::callFromJs<jsi::Value>(
70
+ rt, &T::fetchCreative, jsInvoker_, instance_, std::move(apiKey), std::move(origin), std::move(adSpaceId), std::move(publisherId), std::move(isTestEnvironment));
71
+ }
72
+ jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType, jsi::String origin, jsi::String apiKey, jsi::String bidId, bool isTestEnvironment) override {
73
+ static_assert(
74
+ bridging::getParameterCount(&T::sendCreativeAnalytic) == 9,
75
+ "Expected sendCreativeAnalytic(...) to have 9 parameters");
76
+
77
+ return bridging::callFromJs<jsi::Value>(
78
+ rt, &T::sendCreativeAnalytic, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(eventType), std::move(origin), std::move(apiKey), std::move(bidId), std::move(isTestEnvironment));
79
+ }
80
+
81
+ private:
82
+ friend class NativeAdgeistCxxSpec;
83
+ T *instance_;
84
+ };
85
+
86
+ Delegate delegate_;
87
+ };
88
+
89
+ } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thealteroffice/react-native-adgeist",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
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",
@@ -80,6 +80,7 @@
80
80
  "react": "19.0.0",
81
81
  "react-native": "0.79.2",
82
82
  "react-native-builder-bob": "^0.40.10",
83
+ "react-native-video": "^6.16.1",
83
84
  "release-it": "^17.10.0",
84
85
  "turbo": "^1.10.7",
85
86
  "typescript": "^5.2.2"
@@ -87,7 +88,8 @@
87
88
  "peerDependencies": {
88
89
  "expo": ">=47.0.0",
89
90
  "react": "*",
90
- "react-native": "*"
91
+ "react-native": "*",
92
+ "react-native-video": "^6.16.0"
91
93
  },
92
94
  "peerDependenciesMeta": {
93
95
  "expo": {
@@ -167,8 +169,5 @@
167
169
  "type": "turbo-module",
168
170
  "languages": "kotlin-objc",
169
171
  "version": "0.49.8"
170
- },
171
- "dependencies": {
172
- "react-native-video": "^6.16.0"
173
172
  }
174
173
  }