react-native-liftoffads 0.0.1

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 (95) hide show
  1. package/LICENSE +20 -0
  2. package/NitroLiftoffAds.podspec +26 -0
  3. package/README.md +61 -0
  4. package/android/CMakeLists.txt +20 -0
  5. package/android/build.gradle +132 -0
  6. package/android/consumer-rules.pro +2 -0
  7. package/android/fix-prefab.gradle +46 -0
  8. package/android/gradle.properties +5 -0
  9. package/android/src/main/AndroidManifest.xml +1 -0
  10. package/android/src/main/cpp/cpp-adapter.cpp +7 -0
  11. package/android/src/main/java/com/margelo/nitro/liftoffads/HybridLiftoffAds.kt +121 -0
  12. package/android/src/main/java/com/margelo/nitro/liftoffads/HybridLiftoffInterstitialAd.kt +96 -0
  13. package/android/src/main/java/com/margelo/nitro/liftoffads/HybridLiftoffRewardedAd.kt +104 -0
  14. package/android/src/main/java/com/margelo/nitro/liftoffads/LiftoffAdEventEmitter.kt +51 -0
  15. package/android/src/main/java/com/margelo/nitro/liftoffads/LiftoffAndroidUtils.kt +54 -0
  16. package/android/src/main/java/com/margelo/nitro/liftoffads/NitroLiftoffAdsPackage.java +27 -0
  17. package/ios/HybridLiftoffAds.swift +113 -0
  18. package/ios/HybridLiftoffInterstitialAd.swift +98 -0
  19. package/ios/HybridLiftoffRewardedAd.swift +100 -0
  20. package/ios/LiftoffSupport.swift +106 -0
  21. package/lib/module/index.js +169 -0
  22. package/lib/module/index.js.map +1 -0
  23. package/lib/module/index.test.js +205 -0
  24. package/lib/module/index.test.js.map +1 -0
  25. package/lib/module/package.json +1 -0
  26. package/lib/module/specs/LiftoffAds.nitro.js +4 -0
  27. package/lib/module/specs/LiftoffAds.nitro.js.map +1 -0
  28. package/lib/typescript/package.json +1 -0
  29. package/lib/typescript/src/index.d.ts +72 -0
  30. package/lib/typescript/src/index.d.ts.map +1 -0
  31. package/lib/typescript/src/index.test.d.ts +2 -0
  32. package/lib/typescript/src/index.test.d.ts.map +1 -0
  33. package/lib/typescript/src/specs/LiftoffAds.nitro.d.ts +46 -0
  34. package/lib/typescript/src/specs/LiftoffAds.nitro.d.ts.map +1 -0
  35. package/nitro.json +18 -0
  36. package/nitrogen/generated/android/NitroLiftoffAds+autolinking.cmake +85 -0
  37. package/nitrogen/generated/android/NitroLiftoffAds+autolinking.gradle +27 -0
  38. package/nitrogen/generated/android/NitroLiftoffAdsOnLoad.cpp +50 -0
  39. package/nitrogen/generated/android/NitroLiftoffAdsOnLoad.hpp +25 -0
  40. package/nitrogen/generated/android/c++/JFunc_void_std__optional_LiftoffAdEventPayload_.hpp +78 -0
  41. package/nitrogen/generated/android/c++/JHybridLiftoffAdsSpec.cpp +88 -0
  42. package/nitrogen/generated/android/c++/JHybridLiftoffAdsSpec.hpp +69 -0
  43. package/nitrogen/generated/android/c++/JHybridLiftoffInterstitialAdSpec.cpp +89 -0
  44. package/nitrogen/generated/android/c++/JHybridLiftoffInterstitialAdSpec.hpp +68 -0
  45. package/nitrogen/generated/android/c++/JHybridLiftoffRewardedAdSpec.cpp +93 -0
  46. package/nitrogen/generated/android/c++/JHybridLiftoffRewardedAdSpec.hpp +69 -0
  47. package/nitrogen/generated/android/c++/JLiftoffAdEventPayload.hpp +58 -0
  48. package/nitrogen/generated/android/c++/JLiftoffAdEventType.hpp +77 -0
  49. package/nitrogen/generated/android/c++/JLiftoffAdShowOptions.hpp +53 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/Func_void_std__optional_LiftoffAdEventPayload_.kt +81 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/HybridLiftoffAdsSpec.kt +72 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/HybridLiftoffInterstitialAdSpec.kt +73 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/HybridLiftoffRewardedAdSpec.kt +77 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/LiftoffAdEventPayload.kt +32 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/LiftoffAdEventType.kt +27 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/LiftoffAdShowOptions.kt +29 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/liftoffads/NitroLiftoffAdsOnLoad.kt +35 -0
  58. package/nitrogen/generated/ios/NitroLiftoffAds+autolinking.rb +60 -0
  59. package/nitrogen/generated/ios/NitroLiftoffAds-Swift-Cxx-Bridge.cpp +90 -0
  60. package/nitrogen/generated/ios/NitroLiftoffAds-Swift-Cxx-Bridge.hpp +285 -0
  61. package/nitrogen/generated/ios/NitroLiftoffAds-Swift-Cxx-Umbrella.hpp +66 -0
  62. package/nitrogen/generated/ios/NitroLiftoffAdsAutolinking.mm +33 -0
  63. package/nitrogen/generated/ios/NitroLiftoffAdsAutolinking.swift +25 -0
  64. package/nitrogen/generated/ios/c++/HybridLiftoffAdsSpecSwift.cpp +11 -0
  65. package/nitrogen/generated/ios/c++/HybridLiftoffAdsSpecSwift.hpp +114 -0
  66. package/nitrogen/generated/ios/c++/HybridLiftoffInterstitialAdSpecSwift.cpp +11 -0
  67. package/nitrogen/generated/ios/c++/HybridLiftoffInterstitialAdSpecSwift.hpp +110 -0
  68. package/nitrogen/generated/ios/c++/HybridLiftoffRewardedAdSpecSwift.cpp +11 -0
  69. package/nitrogen/generated/ios/c++/HybridLiftoffRewardedAdSpecSwift.hpp +116 -0
  70. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  71. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  72. package/nitrogen/generated/ios/swift/Func_void_std__optional_LiftoffAdEventPayload_.swift +54 -0
  73. package/nitrogen/generated/ios/swift/HybridLiftoffAdsSpec.swift +54 -0
  74. package/nitrogen/generated/ios/swift/HybridLiftoffAdsSpec_cxx.swift +193 -0
  75. package/nitrogen/generated/ios/swift/HybridLiftoffInterstitialAdSpec.swift +53 -0
  76. package/nitrogen/generated/ios/swift/HybridLiftoffInterstitialAdSpec_cxx.swift +193 -0
  77. package/nitrogen/generated/ios/swift/HybridLiftoffRewardedAdSpec.swift +54 -0
  78. package/nitrogen/generated/ios/swift/HybridLiftoffRewardedAdSpec_cxx.swift +204 -0
  79. package/nitrogen/generated/ios/swift/LiftoffAdEventPayload.swift +77 -0
  80. package/nitrogen/generated/ios/swift/LiftoffAdEventType.swift +64 -0
  81. package/nitrogen/generated/ios/swift/LiftoffAdShowOptions.swift +47 -0
  82. package/nitrogen/generated/shared/c++/HybridLiftoffAdsSpec.cpp +26 -0
  83. package/nitrogen/generated/shared/c++/HybridLiftoffAdsSpec.hpp +74 -0
  84. package/nitrogen/generated/shared/c++/HybridLiftoffInterstitialAdSpec.cpp +25 -0
  85. package/nitrogen/generated/shared/c++/HybridLiftoffInterstitialAdSpec.hpp +76 -0
  86. package/nitrogen/generated/shared/c++/HybridLiftoffRewardedAdSpec.cpp +26 -0
  87. package/nitrogen/generated/shared/c++/HybridLiftoffRewardedAdSpec.hpp +78 -0
  88. package/nitrogen/generated/shared/c++/LiftoffAdEventPayload.hpp +72 -0
  89. package/nitrogen/generated/shared/c++/LiftoffAdEventType.hpp +100 -0
  90. package/nitrogen/generated/shared/c++/LiftoffAdShowOptions.hpp +67 -0
  91. package/package.json +173 -0
  92. package/react-native.config.js +8 -0
  93. package/src/index.test.ts +257 -0
  94. package/src/index.ts +307 -0
  95. package/src/specs/LiftoffAds.nitro.ts +67 -0
@@ -0,0 +1,60 @@
1
+ #
2
+ # NitroLiftoffAds+autolinking.rb
3
+ # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ # https://github.com/mrousavy/nitro
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
+ #
7
+
8
+ # This is a Ruby script that adds all files generated by Nitrogen
9
+ # to the given podspec.
10
+ #
11
+ # To use it, add this to your .podspec:
12
+ # ```ruby
13
+ # Pod::Spec.new do |spec|
14
+ # # ...
15
+ #
16
+ # # Add all files generated by Nitrogen
17
+ # load 'nitrogen/generated/ios/NitroLiftoffAds+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 NitroLiftoffAds is boosted by nitro!"
24
+
25
+ spec.dependency "NitroModules"
26
+
27
+ current_source_files = Array(spec.attributes_hash['source_files'])
28
+ spec.source_files = current_source_files + [
29
+ # Generated cross-platform specs
30
+ "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
31
+ # Generated bridges for the cross-platform specs
32
+ "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
33
+ ]
34
+
35
+ current_public_header_files = Array(spec.attributes_hash['public_header_files'])
36
+ spec.public_header_files = current_public_header_files + [
37
+ # Generated specs
38
+ "nitrogen/generated/shared/**/*.{h,hpp}",
39
+ # Swift to C++ bridging helpers
40
+ "nitrogen/generated/ios/NitroLiftoffAds-Swift-Cxx-Bridge.hpp"
41
+ ]
42
+
43
+ current_private_header_files = Array(spec.attributes_hash['private_header_files'])
44
+ spec.private_header_files = current_private_header_files + [
45
+ # iOS specific specs
46
+ "nitrogen/generated/ios/c++/**/*.{h,hpp}",
47
+ # Views are framework-specific and should be private
48
+ "nitrogen/generated/shared/**/views/**/*"
49
+ ]
50
+
51
+ current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
52
+ spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
+ # Use C++ 20
54
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
+ # Enables C++ <-> Swift interop (by default it's only C)
56
+ "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
+ # Enables stricter modular headers
58
+ "DEFINES_MODULE" => "YES",
59
+ })
60
+ end
@@ -0,0 +1,90 @@
1
+ ///
2
+ /// NitroLiftoffAds-Swift-Cxx-Bridge.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "NitroLiftoffAds-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "HybridLiftoffAdsSpecSwift.hpp"
12
+ #include "HybridLiftoffInterstitialAdSpecSwift.hpp"
13
+ #include "HybridLiftoffRewardedAdSpecSwift.hpp"
14
+ #include "NitroLiftoffAds-Swift-Cxx-Umbrella.hpp"
15
+
16
+ namespace margelo::nitro::liftoffads::bridge::swift {
17
+
18
+ // pragma MARK: std::function<void()>
19
+ Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) noexcept {
20
+ auto swiftClosure = NitroLiftoffAds::Func_void::fromUnsafe(swiftClosureWrapper);
21
+ return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
22
+ swiftClosure.call();
23
+ };
24
+ }
25
+
26
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
27
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) noexcept {
28
+ auto swiftClosure = NitroLiftoffAds::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
29
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
30
+ swiftClosure.call(error);
31
+ };
32
+ }
33
+
34
+ // pragma MARK: std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>
35
+ Func_void_std__optional_LiftoffAdEventPayload_ create_Func_void_std__optional_LiftoffAdEventPayload_(void* _Nonnull swiftClosureWrapper) noexcept {
36
+ auto swiftClosure = NitroLiftoffAds::Func_void_std__optional_LiftoffAdEventPayload_::fromUnsafe(swiftClosureWrapper);
37
+ return [swiftClosure = std::move(swiftClosure)](const std::optional<LiftoffAdEventPayload>& payload) mutable -> void {
38
+ swiftClosure.call(payload);
39
+ };
40
+ }
41
+
42
+ // pragma MARK: std::shared_ptr<HybridLiftoffInterstitialAdSpec>
43
+ std::shared_ptr<HybridLiftoffInterstitialAdSpec> create_std__shared_ptr_HybridLiftoffInterstitialAdSpec_(void* _Nonnull swiftUnsafePointer) noexcept {
44
+ NitroLiftoffAds::HybridLiftoffInterstitialAdSpec_cxx swiftPart = NitroLiftoffAds::HybridLiftoffInterstitialAdSpec_cxx::fromUnsafe(swiftUnsafePointer);
45
+ return std::make_shared<margelo::nitro::liftoffads::HybridLiftoffInterstitialAdSpecSwift>(swiftPart);
46
+ }
47
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffInterstitialAdSpec_(std__shared_ptr_HybridLiftoffInterstitialAdSpec_ cppType) noexcept {
48
+ std::shared_ptr<margelo::nitro::liftoffads::HybridLiftoffInterstitialAdSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::liftoffads::HybridLiftoffInterstitialAdSpecSwift>(cppType);
49
+ #ifdef NITRO_DEBUG
50
+ if (swiftWrapper == nullptr) [[unlikely]] {
51
+ throw std::runtime_error("Class \"HybridLiftoffInterstitialAdSpec\" is not implemented in Swift!");
52
+ }
53
+ #endif
54
+ NitroLiftoffAds::HybridLiftoffInterstitialAdSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
55
+ return swiftPart.toUnsafe();
56
+ }
57
+
58
+ // pragma MARK: std::shared_ptr<HybridLiftoffRewardedAdSpec>
59
+ std::shared_ptr<HybridLiftoffRewardedAdSpec> create_std__shared_ptr_HybridLiftoffRewardedAdSpec_(void* _Nonnull swiftUnsafePointer) noexcept {
60
+ NitroLiftoffAds::HybridLiftoffRewardedAdSpec_cxx swiftPart = NitroLiftoffAds::HybridLiftoffRewardedAdSpec_cxx::fromUnsafe(swiftUnsafePointer);
61
+ return std::make_shared<margelo::nitro::liftoffads::HybridLiftoffRewardedAdSpecSwift>(swiftPart);
62
+ }
63
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffRewardedAdSpec_(std__shared_ptr_HybridLiftoffRewardedAdSpec_ cppType) noexcept {
64
+ std::shared_ptr<margelo::nitro::liftoffads::HybridLiftoffRewardedAdSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::liftoffads::HybridLiftoffRewardedAdSpecSwift>(cppType);
65
+ #ifdef NITRO_DEBUG
66
+ if (swiftWrapper == nullptr) [[unlikely]] {
67
+ throw std::runtime_error("Class \"HybridLiftoffRewardedAdSpec\" is not implemented in Swift!");
68
+ }
69
+ #endif
70
+ NitroLiftoffAds::HybridLiftoffRewardedAdSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
71
+ return swiftPart.toUnsafe();
72
+ }
73
+
74
+ // pragma MARK: std::shared_ptr<HybridLiftoffAdsSpec>
75
+ std::shared_ptr<HybridLiftoffAdsSpec> create_std__shared_ptr_HybridLiftoffAdsSpec_(void* _Nonnull swiftUnsafePointer) noexcept {
76
+ NitroLiftoffAds::HybridLiftoffAdsSpec_cxx swiftPart = NitroLiftoffAds::HybridLiftoffAdsSpec_cxx::fromUnsafe(swiftUnsafePointer);
77
+ return std::make_shared<margelo::nitro::liftoffads::HybridLiftoffAdsSpecSwift>(swiftPart);
78
+ }
79
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffAdsSpec_(std__shared_ptr_HybridLiftoffAdsSpec_ cppType) noexcept {
80
+ std::shared_ptr<margelo::nitro::liftoffads::HybridLiftoffAdsSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::liftoffads::HybridLiftoffAdsSpecSwift>(cppType);
81
+ #ifdef NITRO_DEBUG
82
+ if (swiftWrapper == nullptr) [[unlikely]] {
83
+ throw std::runtime_error("Class \"HybridLiftoffAdsSpec\" is not implemented in Swift!");
84
+ }
85
+ #endif
86
+ NitroLiftoffAds::HybridLiftoffAdsSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
87
+ return swiftPart.toUnsafe();
88
+ }
89
+
90
+ } // namespace margelo::nitro::liftoffads::bridge::swift
@@ -0,0 +1,285 @@
1
+ ///
2
+ /// NitroLiftoffAds-Swift-Cxx-Bridge.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridLiftoffAdsSpec` to properly resolve imports.
12
+ namespace margelo::nitro::liftoffads { class HybridLiftoffAdsSpec; }
13
+ // Forward declaration of `HybridLiftoffInterstitialAdSpec` to properly resolve imports.
14
+ namespace margelo::nitro::liftoffads { class HybridLiftoffInterstitialAdSpec; }
15
+ // Forward declaration of `HybridLiftoffRewardedAdSpec` to properly resolve imports.
16
+ namespace margelo::nitro::liftoffads { class HybridLiftoffRewardedAdSpec; }
17
+ // Forward declaration of `LiftoffAdEventPayload` to properly resolve imports.
18
+ namespace margelo::nitro::liftoffads { struct LiftoffAdEventPayload; }
19
+ // Forward declaration of `LiftoffAdShowOptions` to properly resolve imports.
20
+ namespace margelo::nitro::liftoffads { struct LiftoffAdShowOptions; }
21
+
22
+ // Forward declarations of Swift defined types
23
+ // Forward declaration of `HybridLiftoffAdsSpec_cxx` to properly resolve imports.
24
+ namespace NitroLiftoffAds { class HybridLiftoffAdsSpec_cxx; }
25
+ // Forward declaration of `HybridLiftoffInterstitialAdSpec_cxx` to properly resolve imports.
26
+ namespace NitroLiftoffAds { class HybridLiftoffInterstitialAdSpec_cxx; }
27
+ // Forward declaration of `HybridLiftoffRewardedAdSpec_cxx` to properly resolve imports.
28
+ namespace NitroLiftoffAds { class HybridLiftoffRewardedAdSpec_cxx; }
29
+
30
+ // Include C++ defined types
31
+ #include "HybridLiftoffAdsSpec.hpp"
32
+ #include "HybridLiftoffInterstitialAdSpec.hpp"
33
+ #include "HybridLiftoffRewardedAdSpec.hpp"
34
+ #include "LiftoffAdEventPayload.hpp"
35
+ #include "LiftoffAdShowOptions.hpp"
36
+ #include <NitroModules/Promise.hpp>
37
+ #include <NitroModules/PromiseHolder.hpp>
38
+ #include <NitroModules/Result.hpp>
39
+ #include <exception>
40
+ #include <functional>
41
+ #include <memory>
42
+ #include <optional>
43
+ #include <string>
44
+
45
+ /**
46
+ * Contains specialized versions of C++ templated types so they can be accessed from Swift,
47
+ * as well as helper functions to interact with those C++ types from Swift.
48
+ */
49
+ namespace margelo::nitro::liftoffads::bridge::swift {
50
+
51
+ // pragma MARK: std::shared_ptr<Promise<void>>
52
+ /**
53
+ * Specialized version of `std::shared_ptr<Promise<void>>`.
54
+ */
55
+ using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
56
+ inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
57
+ return Promise<void>::create();
58
+ }
59
+ inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
60
+ return PromiseHolder<void>(std::move(promise));
61
+ }
62
+
63
+ // pragma MARK: std::function<void()>
64
+ /**
65
+ * Specialized version of `std::function<void()>`.
66
+ */
67
+ using Func_void = std::function<void()>;
68
+ /**
69
+ * Wrapper class for a `std::function<void()>`, this can be used from Swift.
70
+ */
71
+ class Func_void_Wrapper final {
72
+ public:
73
+ explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
74
+ inline void call() const noexcept {
75
+ _function->operator()();
76
+ }
77
+ private:
78
+ std::unique_ptr<std::function<void()>> _function;
79
+ } SWIFT_NONCOPYABLE;
80
+ Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) noexcept;
81
+ inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
82
+ return Func_void_Wrapper(std::move(value));
83
+ }
84
+
85
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
86
+ /**
87
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
88
+ */
89
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
90
+ /**
91
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
92
+ */
93
+ class Func_void_std__exception_ptr_Wrapper final {
94
+ public:
95
+ explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
96
+ inline void call(std::exception_ptr error) const noexcept {
97
+ _function->operator()(error);
98
+ }
99
+ private:
100
+ std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
101
+ } SWIFT_NONCOPYABLE;
102
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) noexcept;
103
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
104
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
105
+ }
106
+
107
+ // pragma MARK: std::optional<bool>
108
+ /**
109
+ * Specialized version of `std::optional<bool>`.
110
+ */
111
+ using std__optional_bool_ = std::optional<bool>;
112
+ inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
113
+ return std::optional<bool>(value);
114
+ }
115
+ inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
116
+ return optional.has_value();
117
+ }
118
+ inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
119
+ return *optional;
120
+ }
121
+
122
+ // pragma MARK: std::optional<LiftoffAdShowOptions>
123
+ /**
124
+ * Specialized version of `std::optional<LiftoffAdShowOptions>`.
125
+ */
126
+ using std__optional_LiftoffAdShowOptions_ = std::optional<LiftoffAdShowOptions>;
127
+ inline std::optional<LiftoffAdShowOptions> create_std__optional_LiftoffAdShowOptions_(const LiftoffAdShowOptions& value) noexcept {
128
+ return std::optional<LiftoffAdShowOptions>(value);
129
+ }
130
+ inline bool has_value_std__optional_LiftoffAdShowOptions_(const std::optional<LiftoffAdShowOptions>& optional) noexcept {
131
+ return optional.has_value();
132
+ }
133
+ inline LiftoffAdShowOptions get_std__optional_LiftoffAdShowOptions_(const std::optional<LiftoffAdShowOptions>& optional) noexcept {
134
+ return *optional;
135
+ }
136
+
137
+ // pragma MARK: std::optional<double>
138
+ /**
139
+ * Specialized version of `std::optional<double>`.
140
+ */
141
+ using std__optional_double_ = std::optional<double>;
142
+ inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
143
+ return std::optional<double>(value);
144
+ }
145
+ inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
146
+ return optional.has_value();
147
+ }
148
+ inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
149
+ return *optional;
150
+ }
151
+
152
+ // pragma MARK: std::optional<std::string>
153
+ /**
154
+ * Specialized version of `std::optional<std::string>`.
155
+ */
156
+ using std__optional_std__string_ = std::optional<std::string>;
157
+ inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
158
+ return std::optional<std::string>(value);
159
+ }
160
+ inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
161
+ return optional.has_value();
162
+ }
163
+ inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
164
+ return *optional;
165
+ }
166
+
167
+ // pragma MARK: std::optional<LiftoffAdEventPayload>
168
+ /**
169
+ * Specialized version of `std::optional<LiftoffAdEventPayload>`.
170
+ */
171
+ using std__optional_LiftoffAdEventPayload_ = std::optional<LiftoffAdEventPayload>;
172
+ inline std::optional<LiftoffAdEventPayload> create_std__optional_LiftoffAdEventPayload_(const LiftoffAdEventPayload& value) noexcept {
173
+ return std::optional<LiftoffAdEventPayload>(value);
174
+ }
175
+ inline bool has_value_std__optional_LiftoffAdEventPayload_(const std::optional<LiftoffAdEventPayload>& optional) noexcept {
176
+ return optional.has_value();
177
+ }
178
+ inline LiftoffAdEventPayload get_std__optional_LiftoffAdEventPayload_(const std::optional<LiftoffAdEventPayload>& optional) noexcept {
179
+ return *optional;
180
+ }
181
+
182
+ // pragma MARK: std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>
183
+ /**
184
+ * Specialized version of `std::function<void(const std::optional<LiftoffAdEventPayload>&)>`.
185
+ */
186
+ using Func_void_std__optional_LiftoffAdEventPayload_ = std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>;
187
+ /**
188
+ * Wrapper class for a `std::function<void(const std::optional<LiftoffAdEventPayload>& / * payload * /)>`, this can be used from Swift.
189
+ */
190
+ class Func_void_std__optional_LiftoffAdEventPayload__Wrapper final {
191
+ public:
192
+ explicit Func_void_std__optional_LiftoffAdEventPayload__Wrapper(std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>&& func): _function(std::make_unique<std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>>(std::move(func))) {}
193
+ inline void call(std::optional<LiftoffAdEventPayload> payload) const noexcept {
194
+ _function->operator()(payload);
195
+ }
196
+ private:
197
+ std::unique_ptr<std::function<void(const std::optional<LiftoffAdEventPayload>& /* payload */)>> _function;
198
+ } SWIFT_NONCOPYABLE;
199
+ Func_void_std__optional_LiftoffAdEventPayload_ create_Func_void_std__optional_LiftoffAdEventPayload_(void* _Nonnull swiftClosureWrapper) noexcept;
200
+ inline Func_void_std__optional_LiftoffAdEventPayload__Wrapper wrap_Func_void_std__optional_LiftoffAdEventPayload_(Func_void_std__optional_LiftoffAdEventPayload_ value) noexcept {
201
+ return Func_void_std__optional_LiftoffAdEventPayload__Wrapper(std::move(value));
202
+ }
203
+
204
+ // pragma MARK: std::shared_ptr<HybridLiftoffInterstitialAdSpec>
205
+ /**
206
+ * Specialized version of `std::shared_ptr<HybridLiftoffInterstitialAdSpec>`.
207
+ */
208
+ using std__shared_ptr_HybridLiftoffInterstitialAdSpec_ = std::shared_ptr<HybridLiftoffInterstitialAdSpec>;
209
+ std::shared_ptr<HybridLiftoffInterstitialAdSpec> create_std__shared_ptr_HybridLiftoffInterstitialAdSpec_(void* _Nonnull swiftUnsafePointer) noexcept;
210
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffInterstitialAdSpec_(std__shared_ptr_HybridLiftoffInterstitialAdSpec_ cppType) noexcept;
211
+
212
+ // pragma MARK: std::weak_ptr<HybridLiftoffInterstitialAdSpec>
213
+ using std__weak_ptr_HybridLiftoffInterstitialAdSpec_ = std::weak_ptr<HybridLiftoffInterstitialAdSpec>;
214
+ inline std__weak_ptr_HybridLiftoffInterstitialAdSpec_ weakify_std__shared_ptr_HybridLiftoffInterstitialAdSpec_(const std::shared_ptr<HybridLiftoffInterstitialAdSpec>& strong) noexcept { return strong; }
215
+
216
+ // pragma MARK: Result<void>
217
+ using Result_void_ = Result<void>;
218
+ inline Result_void_ create_Result_void_() noexcept {
219
+ return Result<void>::withValue();
220
+ }
221
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
222
+ return Result<void>::withError(error);
223
+ }
224
+
225
+ // pragma MARK: Result<std::shared_ptr<Promise<void>>>
226
+ using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
227
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
228
+ return Result<std::shared_ptr<Promise<void>>>::withValue(value);
229
+ }
230
+ inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
231
+ return Result<std::shared_ptr<Promise<void>>>::withError(error);
232
+ }
233
+
234
+ // pragma MARK: Result<double>
235
+ using Result_double_ = Result<double>;
236
+ inline Result_double_ create_Result_double_(double value) noexcept {
237
+ return Result<double>::withValue(std::move(value));
238
+ }
239
+ inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
240
+ return Result<double>::withError(error);
241
+ }
242
+
243
+ // pragma MARK: std::shared_ptr<HybridLiftoffRewardedAdSpec>
244
+ /**
245
+ * Specialized version of `std::shared_ptr<HybridLiftoffRewardedAdSpec>`.
246
+ */
247
+ using std__shared_ptr_HybridLiftoffRewardedAdSpec_ = std::shared_ptr<HybridLiftoffRewardedAdSpec>;
248
+ std::shared_ptr<HybridLiftoffRewardedAdSpec> create_std__shared_ptr_HybridLiftoffRewardedAdSpec_(void* _Nonnull swiftUnsafePointer) noexcept;
249
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffRewardedAdSpec_(std__shared_ptr_HybridLiftoffRewardedAdSpec_ cppType) noexcept;
250
+
251
+ // pragma MARK: std::weak_ptr<HybridLiftoffRewardedAdSpec>
252
+ using std__weak_ptr_HybridLiftoffRewardedAdSpec_ = std::weak_ptr<HybridLiftoffRewardedAdSpec>;
253
+ inline std__weak_ptr_HybridLiftoffRewardedAdSpec_ weakify_std__shared_ptr_HybridLiftoffRewardedAdSpec_(const std::shared_ptr<HybridLiftoffRewardedAdSpec>& strong) noexcept { return strong; }
254
+
255
+ // pragma MARK: std::shared_ptr<HybridLiftoffAdsSpec>
256
+ /**
257
+ * Specialized version of `std::shared_ptr<HybridLiftoffAdsSpec>`.
258
+ */
259
+ using std__shared_ptr_HybridLiftoffAdsSpec_ = std::shared_ptr<HybridLiftoffAdsSpec>;
260
+ std::shared_ptr<HybridLiftoffAdsSpec> create_std__shared_ptr_HybridLiftoffAdsSpec_(void* _Nonnull swiftUnsafePointer) noexcept;
261
+ void* _Nonnull get_std__shared_ptr_HybridLiftoffAdsSpec_(std__shared_ptr_HybridLiftoffAdsSpec_ cppType) noexcept;
262
+
263
+ // pragma MARK: std::weak_ptr<HybridLiftoffAdsSpec>
264
+ using std__weak_ptr_HybridLiftoffAdsSpec_ = std::weak_ptr<HybridLiftoffAdsSpec>;
265
+ inline std__weak_ptr_HybridLiftoffAdsSpec_ weakify_std__shared_ptr_HybridLiftoffAdsSpec_(const std::shared_ptr<HybridLiftoffAdsSpec>& strong) noexcept { return strong; }
266
+
267
+ // pragma MARK: Result<std::shared_ptr<HybridLiftoffInterstitialAdSpec>>
268
+ using Result_std__shared_ptr_HybridLiftoffInterstitialAdSpec__ = Result<std::shared_ptr<HybridLiftoffInterstitialAdSpec>>;
269
+ inline Result_std__shared_ptr_HybridLiftoffInterstitialAdSpec__ create_Result_std__shared_ptr_HybridLiftoffInterstitialAdSpec__(const std::shared_ptr<HybridLiftoffInterstitialAdSpec>& value) noexcept {
270
+ return Result<std::shared_ptr<HybridLiftoffInterstitialAdSpec>>::withValue(value);
271
+ }
272
+ inline Result_std__shared_ptr_HybridLiftoffInterstitialAdSpec__ create_Result_std__shared_ptr_HybridLiftoffInterstitialAdSpec__(const std::exception_ptr& error) noexcept {
273
+ return Result<std::shared_ptr<HybridLiftoffInterstitialAdSpec>>::withError(error);
274
+ }
275
+
276
+ // pragma MARK: Result<std::shared_ptr<HybridLiftoffRewardedAdSpec>>
277
+ using Result_std__shared_ptr_HybridLiftoffRewardedAdSpec__ = Result<std::shared_ptr<HybridLiftoffRewardedAdSpec>>;
278
+ inline Result_std__shared_ptr_HybridLiftoffRewardedAdSpec__ create_Result_std__shared_ptr_HybridLiftoffRewardedAdSpec__(const std::shared_ptr<HybridLiftoffRewardedAdSpec>& value) noexcept {
279
+ return Result<std::shared_ptr<HybridLiftoffRewardedAdSpec>>::withValue(value);
280
+ }
281
+ inline Result_std__shared_ptr_HybridLiftoffRewardedAdSpec__ create_Result_std__shared_ptr_HybridLiftoffRewardedAdSpec__(const std::exception_ptr& error) noexcept {
282
+ return Result<std::shared_ptr<HybridLiftoffRewardedAdSpec>>::withError(error);
283
+ }
284
+
285
+ } // namespace margelo::nitro::liftoffads::bridge::swift
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// NitroLiftoffAds-Swift-Cxx-Umbrella.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridLiftoffAdsSpec` to properly resolve imports.
12
+ namespace margelo::nitro::liftoffads { class HybridLiftoffAdsSpec; }
13
+ // Forward declaration of `HybridLiftoffInterstitialAdSpec` to properly resolve imports.
14
+ namespace margelo::nitro::liftoffads { class HybridLiftoffInterstitialAdSpec; }
15
+ // Forward declaration of `HybridLiftoffRewardedAdSpec` to properly resolve imports.
16
+ namespace margelo::nitro::liftoffads { class HybridLiftoffRewardedAdSpec; }
17
+ // Forward declaration of `LiftoffAdEventPayload` to properly resolve imports.
18
+ namespace margelo::nitro::liftoffads { struct LiftoffAdEventPayload; }
19
+ // Forward declaration of `LiftoffAdEventType` to properly resolve imports.
20
+ namespace margelo::nitro::liftoffads { enum class LiftoffAdEventType; }
21
+ // Forward declaration of `LiftoffAdShowOptions` to properly resolve imports.
22
+ namespace margelo::nitro::liftoffads { struct LiftoffAdShowOptions; }
23
+
24
+ // Include C++ defined types
25
+ #include "HybridLiftoffAdsSpec.hpp"
26
+ #include "HybridLiftoffInterstitialAdSpec.hpp"
27
+ #include "HybridLiftoffRewardedAdSpec.hpp"
28
+ #include "LiftoffAdEventPayload.hpp"
29
+ #include "LiftoffAdEventType.hpp"
30
+ #include "LiftoffAdShowOptions.hpp"
31
+ #include <NitroModules/Promise.hpp>
32
+ #include <NitroModules/Result.hpp>
33
+ #include <exception>
34
+ #include <functional>
35
+ #include <memory>
36
+ #include <optional>
37
+ #include <string>
38
+
39
+ // C++ helpers for Swift
40
+ #include "NitroLiftoffAds-Swift-Cxx-Bridge.hpp"
41
+
42
+ // Common C++ types used in Swift
43
+ #include <NitroModules/ArrayBufferHolder.hpp>
44
+ #include <NitroModules/AnyMapUtils.hpp>
45
+ #include <NitroModules/RuntimeError.hpp>
46
+ #include <NitroModules/DateToChronoDate.hpp>
47
+
48
+ // Forward declarations of Swift defined types
49
+ // Forward declaration of `HybridLiftoffAdsSpec_cxx` to properly resolve imports.
50
+ namespace NitroLiftoffAds { class HybridLiftoffAdsSpec_cxx; }
51
+ // Forward declaration of `HybridLiftoffInterstitialAdSpec_cxx` to properly resolve imports.
52
+ namespace NitroLiftoffAds { class HybridLiftoffInterstitialAdSpec_cxx; }
53
+ // Forward declaration of `HybridLiftoffRewardedAdSpec_cxx` to properly resolve imports.
54
+ namespace NitroLiftoffAds { class HybridLiftoffRewardedAdSpec_cxx; }
55
+
56
+ // Include Swift defined types
57
+ #if __has_include("NitroLiftoffAds-Swift.h")
58
+ // This header is generated by Xcode/Swift on every app build.
59
+ // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroLiftoffAds".
60
+ #include "NitroLiftoffAds-Swift.h"
61
+ // Same as above, but used when building with frameworks (`use_frameworks`)
62
+ #elif __has_include(<NitroLiftoffAds/NitroLiftoffAds-Swift.h>)
63
+ #include <NitroLiftoffAds/NitroLiftoffAds-Swift.h>
64
+ #else
65
+ #error NitroLiftoffAds's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroLiftoffAds", and try building the app first.
66
+ #endif
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// NitroLiftoffAdsAutolinking.mm
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <NitroModules/HybridObjectRegistry.hpp>
10
+ #import "NitroLiftoffAds-Swift-Cxx-Umbrella.hpp"
11
+ #import <type_traits>
12
+
13
+ #include "HybridLiftoffAdsSpecSwift.hpp"
14
+
15
+ @interface NitroLiftoffAdsAutolinking : NSObject
16
+ @end
17
+
18
+ @implementation NitroLiftoffAdsAutolinking
19
+
20
+ + (void) load {
21
+ using namespace margelo::nitro;
22
+ using namespace margelo::nitro::liftoffads;
23
+
24
+ HybridObjectRegistry::registerHybridObjectConstructor(
25
+ "LiftoffAds",
26
+ []() -> std::shared_ptr<HybridObject> {
27
+ std::shared_ptr<HybridLiftoffAdsSpec> hybridObject = NitroLiftoffAds::NitroLiftoffAdsAutolinking::createLiftoffAds();
28
+ return hybridObject;
29
+ }
30
+ );
31
+ }
32
+
33
+ @end
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// NitroLiftoffAdsAutolinking.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ public final class NitroLiftoffAdsAutolinking {
9
+ public typealias bridge = margelo.nitro.liftoffads.bridge.swift
10
+
11
+ /**
12
+ * Creates an instance of a Swift class that implements `HybridLiftoffAdsSpec`,
13
+ * and wraps it in a Swift class that can directly interop with C++ (`HybridLiftoffAdsSpec_cxx`)
14
+ *
15
+ * This is generated by Nitrogen and will initialize the class specified
16
+ * in the `"autolinking"` property of `nitro.json` (in this case, `HybridLiftoffAds`).
17
+ */
18
+ public static func createLiftoffAds() -> bridge.std__shared_ptr_HybridLiftoffAdsSpec_ {
19
+ let hybridObject = HybridLiftoffAds()
20
+ return { () -> bridge.std__shared_ptr_HybridLiftoffAdsSpec_ in
21
+ let __cxxWrapped = hybridObject.getCxxWrapper()
22
+ return __cxxWrapped.getCxxPart()
23
+ }()
24
+ }
25
+ }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridLiftoffAdsSpecSwift.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridLiftoffAdsSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::liftoffads {
11
+ } // namespace margelo::nitro::liftoffads