@thealteroffice/react-native-adgeist 0.0.1 → 0.0.3

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 (43) hide show
  1. package/Adgeist.podspec +6 -5
  2. package/README.md +12 -2
  3. package/android/build.gradle +21 -8
  4. package/android/src/main/java/com/adgeist/AdgeistPackage.kt +5 -4
  5. package/android/src/main/java/com/adgeist/{AdgeistModule.kt → implementation/AdgeistModuleImpl.kt} +8 -18
  6. package/android/src/newarch/java/com/AdgeistModule.kt +22 -0
  7. package/android/src/oldarch/java/com/AdgeistModule.kt +26 -0
  8. package/app.plugin.js +1 -0
  9. package/ios/Adgeist.h +1 -3
  10. package/ios/Adgeist.mm +24 -19
  11. package/ios/adgeist-Bridging-Header.h +1 -2
  12. package/lib/module/NativeAdgeist.js +5 -0
  13. package/lib/module/NativeAdgeist.js.map +1 -0
  14. package/lib/module/components/BannerAd.js +1 -1
  15. package/lib/module/components/BannerAd.js.map +1 -1
  16. package/lib/module/components/BottomBannerAd.js +1 -1
  17. package/lib/module/components/BottomBannerAd.js.map +1 -1
  18. package/lib/typescript/plugin/src/android/withRNAdgeistMainApplication.d.ts +4 -0
  19. package/lib/typescript/plugin/src/android/withRNAdgeistMainApplication.d.ts.map +1 -0
  20. package/lib/typescript/plugin/src/index.d.ts +4 -0
  21. package/lib/typescript/plugin/src/index.d.ts.map +1 -0
  22. package/lib/typescript/plugin/src/ios/withRNAdgeistAppDelegate.d.ts +5 -0
  23. package/lib/typescript/plugin/src/ios/withRNAdgeistAppDelegate.d.ts.map +1 -0
  24. package/package.json +21 -20
  25. package/plugin/build/android/withRNAdgeistMainApplication.d.ts +3 -0
  26. package/plugin/build/android/withRNAdgeistMainApplication.js +65 -0
  27. package/plugin/build/index.d.ts +3 -0
  28. package/plugin/build/index.js +25 -0
  29. package/plugin/build/ios/withRNAdgeistAppDelegate.d.ts +4 -0
  30. package/plugin/build/ios/withRNAdgeistAppDelegate.js +66 -0
  31. package/plugin/tsconfig.json +9 -0
  32. package/react-native.config.js +1 -1
  33. package/android/generated/java/com/adgeist/NativeAdgeistSpec.java +0 -42
  34. package/android/generated/jni/CMakeLists.txt +0 -36
  35. package/android/generated/jni/RNAdgeistSpec-generated.cpp +0 -38
  36. package/android/generated/jni/RNAdgeistSpec.h +0 -31
  37. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +0 -38
  38. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +0 -80
  39. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec-generated.mm +0 -46
  40. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec.h +0 -71
  41. package/ios/generated/RNAdgeistSpecJSI-generated.cpp +0 -38
  42. package/ios/generated/RNAdgeistSpecJSI.h +0 -80
  43. package/lib/module/NativeAdgeist.ts +0 -14
@@ -0,0 +1,25 @@
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);
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,66 @@
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
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.plugin",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }
@@ -5,7 +5,7 @@ module.exports = {
5
5
  dependency: {
6
6
  platforms: {
7
7
  android: {
8
- cmakeListsPath: 'generated/jni/CMakeLists.txt',
8
+ cmakeListsPath: 'build/generated/source/codegen/jni/CMakeLists.txt',
9
9
  },
10
10
  },
11
11
  },
@@ -1,42 +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.adgeist;
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 fetchCreative(String adSpaceId, String publisherId, Promise promise);
38
-
39
- @ReactMethod
40
- @DoNotStrip
41
- public abstract void sendCreativeAnalytic(String campaignId, String adSpaceId, String publisherId, String eventType, Promise promise);
42
- }
@@ -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,38 +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_fetchCreative(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, "fetchCreative", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
- }
19
-
20
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic(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, "sendCreativeAnalytic", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
- }
24
-
25
- NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const JavaTurboModule::InitParams &params)
26
- : JavaTurboModule(params) {
27
- methodMap_["fetchCreative"] = MethodMetadata {2, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
28
- methodMap_["sendCreativeAnalytic"] = MethodMetadata {4, __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic};
29
- }
30
-
31
- std::shared_ptr<TurboModule> RNAdgeistSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
32
- if (moduleName == "Adgeist") {
33
- return std::make_shared<NativeAdgeistSpecJSI>(params);
34
- }
35
- return nullptr;
36
- }
37
-
38
- } // 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,38 +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_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
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
- );
20
- }
21
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
22
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->sendCreativeAnalytic(
23
- rt,
24
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
25
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
26
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
27
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt)
28
- );
29
- }
30
-
31
- NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
32
- : TurboModule("Adgeist", jsInvoker) {
33
- methodMap_["fetchCreative"] = MethodMetadata {2, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
34
- methodMap_["sendCreativeAnalytic"] = MethodMetadata {4, __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic};
35
- }
36
-
37
-
38
- } // namespace facebook::react
@@ -1,80 +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 fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String publisherId) = 0;
24
- virtual jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType) = 0;
25
-
26
- };
27
-
28
- template <typename T>
29
- class JSI_EXPORT NativeAdgeistCxxSpec : public TurboModule {
30
- public:
31
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
32
- return delegate_.create(rt, propName);
33
- }
34
-
35
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
36
- return delegate_.getPropertyNames(runtime);
37
- }
38
-
39
- static constexpr std::string_view kModuleName = "Adgeist";
40
-
41
- protected:
42
- NativeAdgeistCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
43
- : TurboModule(std::string{NativeAdgeistCxxSpec::kModuleName}, jsInvoker),
44
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
45
-
46
-
47
- private:
48
- class Delegate : public NativeAdgeistCxxSpecJSI {
49
- public:
50
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
51
- NativeAdgeistCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
52
-
53
- }
54
-
55
- jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String publisherId) override {
56
- static_assert(
57
- bridging::getParameterCount(&T::fetchCreative) == 3,
58
- "Expected fetchCreative(...) to have 3 parameters");
59
-
60
- return bridging::callFromJs<jsi::Value>(
61
- rt, &T::fetchCreative, jsInvoker_, instance_, std::move(adSpaceId), std::move(publisherId));
62
- }
63
- jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType) override {
64
- static_assert(
65
- bridging::getParameterCount(&T::sendCreativeAnalytic) == 5,
66
- "Expected sendCreativeAnalytic(...) to have 5 parameters");
67
-
68
- return bridging::callFromJs<jsi::Value>(
69
- rt, &T::sendCreativeAnalytic, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(eventType));
70
- }
71
-
72
- private:
73
- friend class NativeAdgeistCxxSpec;
74
- T *instance_;
75
- };
76
-
77
- Delegate delegate_;
78
- };
79
-
80
- } // namespace facebook::react
@@ -1,46 +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: GenerateModuleObjCpp
8
- *
9
- * We create an umbrella header (and corresponding implementation) here since
10
- * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
- * must have a single output. More files => more genrule()s => slower builds.
12
- */
13
-
14
- #import "RNAdgeistSpec.h"
15
-
16
-
17
- @implementation NativeAdgeistSpecBase
18
-
19
-
20
- - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
21
- {
22
- _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
23
- }
24
- @end
25
-
26
-
27
- namespace facebook::react {
28
-
29
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_fetchCreative(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
- return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "fetchCreative", @selector(fetchCreative:publisherId:resolve:reject:), args, count);
31
- }
32
-
33
- static facebook::jsi::Value __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
34
- return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "sendCreativeAnalytic", @selector(sendCreativeAnalytic:adSpaceId:publisherId:eventType:resolve:reject:), args, count);
35
- }
36
-
37
- NativeAdgeistSpecJSI::NativeAdgeistSpecJSI(const ObjCTurboModule::InitParams &params)
38
- : ObjCTurboModule(params) {
39
-
40
- methodMap_["fetchCreative"] = MethodMetadata {2, __hostFunction_NativeAdgeistSpecJSI_fetchCreative};
41
-
42
-
43
- methodMap_["sendCreativeAnalytic"] = MethodMetadata {4, __hostFunction_NativeAdgeistSpecJSI_sendCreativeAnalytic};
44
-
45
- }
46
- } // namespace facebook::react
@@ -1,71 +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: GenerateModuleObjCpp
8
- *
9
- * We create an umbrella header (and corresponding implementation) here since
10
- * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
- * must have a single output. More files => more genrule()s => slower builds.
12
- */
13
-
14
- #ifndef __cplusplus
15
- #error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
16
- #endif
17
-
18
- // Avoid multiple includes of RNAdgeistSpec symbols
19
- #ifndef RNAdgeistSpec_H
20
- #define RNAdgeistSpec_H
21
-
22
- #import <Foundation/Foundation.h>
23
- #import <RCTRequired/RCTRequired.h>
24
- #import <RCTTypeSafety/RCTConvertHelpers.h>
25
- #import <RCTTypeSafety/RCTTypedModuleConstants.h>
26
- #import <React/RCTBridgeModule.h>
27
- #import <React/RCTCxxConvert.h>
28
- #import <React/RCTManagedPointer.h>
29
- #import <ReactCommon/RCTTurboModule.h>
30
- #import <optional>
31
- #import <vector>
32
-
33
-
34
- NS_ASSUME_NONNULL_BEGIN
35
-
36
- @protocol NativeAdgeistSpec <RCTBridgeModule, RCTTurboModule>
37
-
38
- - (void)fetchCreative:(NSString *)adSpaceId
39
- publisherId:(NSString *)publisherId
40
- resolve:(RCTPromiseResolveBlock)resolve
41
- reject:(RCTPromiseRejectBlock)reject;
42
- - (void)sendCreativeAnalytic:(NSString *)campaignId
43
- adSpaceId:(NSString *)adSpaceId
44
- publisherId:(NSString *)publisherId
45
- eventType:(NSString *)eventType
46
- resolve:(RCTPromiseResolveBlock)resolve
47
- reject:(RCTPromiseRejectBlock)reject;
48
-
49
- @end
50
-
51
- @interface NativeAdgeistSpecBase : NSObject {
52
- @protected
53
- facebook::react::EventEmitterCallback _eventEmitterCallback;
54
- }
55
- - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
56
-
57
-
58
- @end
59
-
60
- namespace facebook::react {
61
- /**
62
- * ObjC++ class for module 'NativeAdgeist'
63
- */
64
- class JSI_EXPORT NativeAdgeistSpecJSI : public ObjCTurboModule {
65
- public:
66
- NativeAdgeistSpecJSI(const ObjCTurboModule::InitParams &params);
67
- };
68
- } // namespace facebook::react
69
-
70
- NS_ASSUME_NONNULL_END
71
- #endif // RNAdgeistSpec_H
@@ -1,38 +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_fetchCreative(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->fetchCreative(
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
- );
20
- }
21
- static jsi::Value __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
22
- return static_cast<NativeAdgeistCxxSpecJSI *>(&turboModule)->sendCreativeAnalytic(
23
- rt,
24
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
25
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
26
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
27
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asString(rt)
28
- );
29
- }
30
-
31
- NativeAdgeistCxxSpecJSI::NativeAdgeistCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
32
- : TurboModule("Adgeist", jsInvoker) {
33
- methodMap_["fetchCreative"] = MethodMetadata {2, __hostFunction_NativeAdgeistCxxSpecJSI_fetchCreative};
34
- methodMap_["sendCreativeAnalytic"] = MethodMetadata {4, __hostFunction_NativeAdgeistCxxSpecJSI_sendCreativeAnalytic};
35
- }
36
-
37
-
38
- } // namespace facebook::react
@@ -1,80 +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 fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String publisherId) = 0;
24
- virtual jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType) = 0;
25
-
26
- };
27
-
28
- template <typename T>
29
- class JSI_EXPORT NativeAdgeistCxxSpec : public TurboModule {
30
- public:
31
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
32
- return delegate_.create(rt, propName);
33
- }
34
-
35
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
36
- return delegate_.getPropertyNames(runtime);
37
- }
38
-
39
- static constexpr std::string_view kModuleName = "Adgeist";
40
-
41
- protected:
42
- NativeAdgeistCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
43
- : TurboModule(std::string{NativeAdgeistCxxSpec::kModuleName}, jsInvoker),
44
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
45
-
46
-
47
- private:
48
- class Delegate : public NativeAdgeistCxxSpecJSI {
49
- public:
50
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
51
- NativeAdgeistCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
52
-
53
- }
54
-
55
- jsi::Value fetchCreative(jsi::Runtime &rt, jsi::String adSpaceId, jsi::String publisherId) override {
56
- static_assert(
57
- bridging::getParameterCount(&T::fetchCreative) == 3,
58
- "Expected fetchCreative(...) to have 3 parameters");
59
-
60
- return bridging::callFromJs<jsi::Value>(
61
- rt, &T::fetchCreative, jsInvoker_, instance_, std::move(adSpaceId), std::move(publisherId));
62
- }
63
- jsi::Value sendCreativeAnalytic(jsi::Runtime &rt, jsi::String campaignId, jsi::String adSpaceId, jsi::String publisherId, jsi::String eventType) override {
64
- static_assert(
65
- bridging::getParameterCount(&T::sendCreativeAnalytic) == 5,
66
- "Expected sendCreativeAnalytic(...) to have 5 parameters");
67
-
68
- return bridging::callFromJs<jsi::Value>(
69
- rt, &T::sendCreativeAnalytic, jsInvoker_, instance_, std::move(campaignId), std::move(adSpaceId), std::move(publisherId), std::move(eventType));
70
- }
71
-
72
- private:
73
- friend class NativeAdgeistCxxSpec;
74
- T *instance_;
75
- };
76
-
77
- Delegate delegate_;
78
- };
79
-
80
- } // namespace facebook::react
@@ -1,14 +0,0 @@
1
- import type { TurboModule } from 'react-native';
2
- import { TurboModuleRegistry } from 'react-native';
3
-
4
- export interface Spec extends TurboModule {
5
- fetchCreative(adSpaceId: string, publisherId: string): Promise<Object>;
6
- sendCreativeAnalytic(
7
- campaignId: string,
8
- adSpaceId: string,
9
- publisherId: string,
10
- eventType: string
11
- ): Promise<Object>;
12
- }
13
-
14
- export default TurboModuleRegistry.getEnforcing<Spec>('Adgeist');