react-native-push-signal 0.1.0

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 (91) hide show
  1. package/LICENSE +20 -0
  2. package/PushSignal.podspec +31 -0
  3. package/README.md +125 -0
  4. package/README.ru.md +125 -0
  5. package/android/CMakeLists.txt +24 -0
  6. package/android/build.gradle +115 -0
  7. package/android/src/main/AndroidManifest.xml +18 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +11 -0
  9. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignal.kt +44 -0
  10. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalCenter.kt +353 -0
  11. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalInitProvider.kt +34 -0
  12. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalMessagingService.kt +15 -0
  13. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalPackage.kt +22 -0
  14. package/ios/PushSignal.swift +38 -0
  15. package/ios/PushSignalCenter.swift +430 -0
  16. package/ios/PushSignalLaunchStore.h +21 -0
  17. package/ios/PushSignalLaunchStore.m +26 -0
  18. package/lib/module/PushSignal.nitro.js +4 -0
  19. package/lib/module/PushSignal.nitro.js.map +1 -0
  20. package/lib/module/index.js +4 -0
  21. package/lib/module/index.js.map +1 -0
  22. package/lib/module/package.json +1 -0
  23. package/lib/module/pushSignal.js +19 -0
  24. package/lib/module/pushSignal.js.map +1 -0
  25. package/lib/module/pushSignal.native.js +46 -0
  26. package/lib/module/pushSignal.native.js.map +1 -0
  27. package/lib/typescript/package.json +1 -0
  28. package/lib/typescript/src/PushSignal.nitro.d.ts +33 -0
  29. package/lib/typescript/src/PushSignal.nitro.d.ts.map +1 -0
  30. package/lib/typescript/src/index.d.ts +3 -0
  31. package/lib/typescript/src/index.d.ts.map +1 -0
  32. package/lib/typescript/src/pushSignal.d.ts +8 -0
  33. package/lib/typescript/src/pushSignal.d.ts.map +1 -0
  34. package/lib/typescript/src/pushSignal.native.d.ts +8 -0
  35. package/lib/typescript/src/pushSignal.native.d.ts.map +1 -0
  36. package/nitro.json +23 -0
  37. package/nitrogen/generated/android/c++/JAndroidFirebaseConfig.hpp +70 -0
  38. package/nitrogen/generated/android/c++/JFunc_void_PushMessage.hpp +80 -0
  39. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.cpp +138 -0
  40. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.hpp +68 -0
  41. package/nitrogen/generated/android/c++/JPermissionStatus.hpp +61 -0
  42. package/nitrogen/generated/android/c++/JPushCredentials.hpp +70 -0
  43. package/nitrogen/generated/android/c++/JPushEnvironment.hpp +58 -0
  44. package/nitrogen/generated/android/c++/JPushMessage.hpp +84 -0
  45. package/nitrogen/generated/android/c++/JPushPlatform.hpp +58 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/AndroidFirebaseConfig.kt +66 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/Func_void_PushMessage.kt +78 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/HybridPushSignalSpec.kt +87 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PermissionStatus.kt +24 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushCredentials.kt +61 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushEnvironment.kt +23 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushMessage.kt +66 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushPlatform.kt +23 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/pushsignalOnLoad.kt +35 -0
  55. package/nitrogen/generated/android/pushsignal+autolinking.cmake +81 -0
  56. package/nitrogen/generated/android/pushsignal+autolinking.gradle +27 -0
  57. package/nitrogen/generated/android/pushsignalOnLoad.cpp +56 -0
  58. package/nitrogen/generated/android/pushsignalOnLoad.hpp +34 -0
  59. package/nitrogen/generated/ios/PushSignal+autolinking.rb +62 -0
  60. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.cpp +65 -0
  61. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.hpp +257 -0
  62. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Umbrella.hpp +66 -0
  63. package/nitrogen/generated/ios/PushSignalAutolinking.mm +33 -0
  64. package/nitrogen/generated/ios/PushSignalAutolinking.swift +26 -0
  65. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.cpp +11 -0
  66. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.hpp +137 -0
  67. package/nitrogen/generated/ios/swift/AndroidFirebaseConfig.swift +96 -0
  68. package/nitrogen/generated/ios/swift/Func_void_PermissionStatus.swift +46 -0
  69. package/nitrogen/generated/ios/swift/Func_void_PushCredentials.swift +46 -0
  70. package/nitrogen/generated/ios/swift/Func_void_PushMessage.swift +46 -0
  71. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  72. package/nitrogen/generated/ios/swift/HybridPushSignalSpec.swift +60 -0
  73. package/nitrogen/generated/ios/swift/HybridPushSignalSpec_cxx.swift +226 -0
  74. package/nitrogen/generated/ios/swift/PermissionStatus.swift +44 -0
  75. package/nitrogen/generated/ios/swift/PushCredentials.swift +45 -0
  76. package/nitrogen/generated/ios/swift/PushEnvironment.swift +40 -0
  77. package/nitrogen/generated/ios/swift/PushMessage.swift +97 -0
  78. package/nitrogen/generated/ios/swift/PushPlatform.swift +40 -0
  79. package/nitrogen/generated/shared/c++/AndroidFirebaseConfig.hpp +96 -0
  80. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.cpp +26 -0
  81. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.hpp +79 -0
  82. package/nitrogen/generated/shared/c++/PermissionStatus.hpp +80 -0
  83. package/nitrogen/generated/shared/c++/PushCredentials.hpp +97 -0
  84. package/nitrogen/generated/shared/c++/PushEnvironment.hpp +76 -0
  85. package/nitrogen/generated/shared/c++/PushMessage.hpp +97 -0
  86. package/nitrogen/generated/shared/c++/PushPlatform.hpp +76 -0
  87. package/package.json +187 -0
  88. package/src/PushSignal.nitro.ts +37 -0
  89. package/src/index.tsx +16 -0
  90. package/src/pushSignal.native.tsx +67 -0
  91. package/src/pushSignal.tsx +32 -0
@@ -0,0 +1,34 @@
1
+ ///
2
+ /// pushsignalOnLoad.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include <jni.h>
9
+ #include <functional>
10
+ #include <NitroModules/NitroDefines.hpp>
11
+
12
+ namespace margelo::nitro::pushsignal {
13
+
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
17
+ /**
18
+ * Register the native (C++) part of pushsignal, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
21
+ * Example:
22
+ * ```cpp (cpp-adapter.cpp)
23
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all pushsignal HybridObjects
26
+ * margelo::nitro::pushsignal::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
29
+ * }
30
+ * ```
31
+ */
32
+ void registerAllNatives();
33
+
34
+ } // namespace margelo::nitro::pushsignal
@@ -0,0 +1,62 @@
1
+ #
2
+ # PushSignal+autolinking.rb
3
+ # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ # https://github.com/mrousavy/nitro
5
+ # Copyright © 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/PushSignal+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 PushSignal 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/PushSignal-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 ObjC)
56
+ "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
+ # Enables stricter modular headers
58
+ "DEFINES_MODULE" => "YES",
59
+ # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
60
+ "SWIFT_INSTALL_OBJC_HEADER" => "NO",
61
+ })
62
+ end
@@ -0,0 +1,65 @@
1
+ ///
2
+ /// PushSignal-Swift-Cxx-Bridge.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "PushSignal-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "HybridPushSignalSpecSwift.hpp"
12
+ #include "PushSignal-Swift-Cxx-Umbrella.hpp"
13
+ #include <NitroModules/NitroDefines.hpp>
14
+
15
+ namespace margelo::nitro::pushsignal::bridge::swift {
16
+
17
+ // pragma MARK: std::function<void(PermissionStatus /* result */)>
18
+ Func_void_PermissionStatus create_Func_void_PermissionStatus(void* NON_NULL swiftClosureWrapper) noexcept {
19
+ auto swiftClosure = PushSignal::Func_void_PermissionStatus::fromUnsafe(swiftClosureWrapper);
20
+ return [swiftClosure = std::move(swiftClosure)](PermissionStatus result) mutable -> void {
21
+ swiftClosure.call(static_cast<int>(result));
22
+ };
23
+ }
24
+
25
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
26
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
27
+ auto swiftClosure = PushSignal::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
28
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
29
+ swiftClosure.call(error);
30
+ };
31
+ }
32
+
33
+ // pragma MARK: std::function<void(const PushCredentials& /* result */)>
34
+ Func_void_PushCredentials create_Func_void_PushCredentials(void* NON_NULL swiftClosureWrapper) noexcept {
35
+ auto swiftClosure = PushSignal::Func_void_PushCredentials::fromUnsafe(swiftClosureWrapper);
36
+ return [swiftClosure = std::move(swiftClosure)](const PushCredentials& result) mutable -> void {
37
+ swiftClosure.call(result);
38
+ };
39
+ }
40
+
41
+ // pragma MARK: std::function<void(const PushMessage& /* message */)>
42
+ Func_void_PushMessage create_Func_void_PushMessage(void* NON_NULL swiftClosureWrapper) noexcept {
43
+ auto swiftClosure = PushSignal::Func_void_PushMessage::fromUnsafe(swiftClosureWrapper);
44
+ return [swiftClosure = std::move(swiftClosure)](const PushMessage& message) mutable -> void {
45
+ swiftClosure.call(message);
46
+ };
47
+ }
48
+
49
+ // pragma MARK: std::shared_ptr<HybridPushSignalSpec>
50
+ std::shared_ptr<HybridPushSignalSpec> create_std__shared_ptr_HybridPushSignalSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
51
+ PushSignal::HybridPushSignalSpec_cxx swiftPart = PushSignal::HybridPushSignalSpec_cxx::fromUnsafe(swiftUnsafePointer);
52
+ return std::make_shared<margelo::nitro::pushsignal::HybridPushSignalSpecSwift>(swiftPart);
53
+ }
54
+ void* NON_NULL get_std__shared_ptr_HybridPushSignalSpec_(std__shared_ptr_HybridPushSignalSpec_ cppType) {
55
+ std::shared_ptr<margelo::nitro::pushsignal::HybridPushSignalSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::pushsignal::HybridPushSignalSpecSwift>(cppType);
56
+ #ifdef NITRO_DEBUG
57
+ if (swiftWrapper == nullptr) [[unlikely]] {
58
+ throw std::runtime_error("Class \"HybridPushSignalSpec\" is not implemented in Swift!");
59
+ }
60
+ #endif
61
+ PushSignal::HybridPushSignalSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
62
+ return swiftPart.toUnsafe();
63
+ }
64
+
65
+ } // namespace margelo::nitro::pushsignal::bridge::swift
@@ -0,0 +1,257 @@
1
+ ///
2
+ /// PushSignal-Swift-Cxx-Bridge.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridPushSignalSpec` to properly resolve imports.
12
+ namespace margelo::nitro::pushsignal { class HybridPushSignalSpec; }
13
+ // Forward declaration of `PermissionStatus` to properly resolve imports.
14
+ namespace margelo::nitro::pushsignal { enum class PermissionStatus; }
15
+ // Forward declaration of `PushCredentials` to properly resolve imports.
16
+ namespace margelo::nitro::pushsignal { struct PushCredentials; }
17
+ // Forward declaration of `PushEnvironment` to properly resolve imports.
18
+ namespace margelo::nitro::pushsignal { enum class PushEnvironment; }
19
+ // Forward declaration of `PushMessage` to properly resolve imports.
20
+ namespace margelo::nitro::pushsignal { struct PushMessage; }
21
+ // Forward declaration of `PushPlatform` to properly resolve imports.
22
+ namespace margelo::nitro::pushsignal { enum class PushPlatform; }
23
+
24
+ // Forward declarations of Swift defined types
25
+ // Forward declaration of `HybridPushSignalSpec_cxx` to properly resolve imports.
26
+ namespace PushSignal { class HybridPushSignalSpec_cxx; }
27
+
28
+ // Include C++ defined types
29
+ #include "HybridPushSignalSpec.hpp"
30
+ #include "PermissionStatus.hpp"
31
+ #include "PushCredentials.hpp"
32
+ #include "PushEnvironment.hpp"
33
+ #include "PushMessage.hpp"
34
+ #include "PushPlatform.hpp"
35
+ #include <NitroModules/Promise.hpp>
36
+ #include <NitroModules/PromiseHolder.hpp>
37
+ #include <NitroModules/Result.hpp>
38
+ #include <exception>
39
+ #include <functional>
40
+ #include <memory>
41
+ #include <optional>
42
+ #include <string>
43
+ #include <unordered_map>
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::pushsignal::bridge::swift {
50
+
51
+ // pragma MARK: std::optional<std::string>
52
+ /**
53
+ * Specialized version of `std::optional<std::string>`.
54
+ */
55
+ using std__optional_std__string_ = std::optional<std::string>;
56
+ inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
57
+ return std::optional<std::string>(value);
58
+ }
59
+ inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
60
+ return optional.has_value();
61
+ }
62
+ inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
63
+ return optional.value();
64
+ }
65
+
66
+ // pragma MARK: std::shared_ptr<Promise<PermissionStatus>>
67
+ /**
68
+ * Specialized version of `std::shared_ptr<Promise<PermissionStatus>>`.
69
+ */
70
+ using std__shared_ptr_Promise_PermissionStatus__ = std::shared_ptr<Promise<PermissionStatus>>;
71
+ inline std::shared_ptr<Promise<PermissionStatus>> create_std__shared_ptr_Promise_PermissionStatus__() noexcept {
72
+ return Promise<PermissionStatus>::create();
73
+ }
74
+ inline PromiseHolder<PermissionStatus> wrap_std__shared_ptr_Promise_PermissionStatus__(std::shared_ptr<Promise<PermissionStatus>> promise) noexcept {
75
+ return PromiseHolder<PermissionStatus>(std::move(promise));
76
+ }
77
+
78
+ // pragma MARK: std::function<void(PermissionStatus /* result */)>
79
+ /**
80
+ * Specialized version of `std::function<void(PermissionStatus)>`.
81
+ */
82
+ using Func_void_PermissionStatus = std::function<void(PermissionStatus /* result */)>;
83
+ /**
84
+ * Wrapper class for a `std::function<void(PermissionStatus / * result * /)>`, this can be used from Swift.
85
+ */
86
+ class Func_void_PermissionStatus_Wrapper final {
87
+ public:
88
+ explicit Func_void_PermissionStatus_Wrapper(std::function<void(PermissionStatus /* result */)>&& func): _function(std::make_unique<std::function<void(PermissionStatus /* result */)>>(std::move(func))) {}
89
+ inline void call(int result) const noexcept {
90
+ _function->operator()(static_cast<PermissionStatus>(result));
91
+ }
92
+ private:
93
+ std::unique_ptr<std::function<void(PermissionStatus /* result */)>> _function;
94
+ } SWIFT_NONCOPYABLE;
95
+ Func_void_PermissionStatus create_Func_void_PermissionStatus(void* NON_NULL swiftClosureWrapper) noexcept;
96
+ inline Func_void_PermissionStatus_Wrapper wrap_Func_void_PermissionStatus(Func_void_PermissionStatus value) noexcept {
97
+ return Func_void_PermissionStatus_Wrapper(std::move(value));
98
+ }
99
+
100
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
101
+ /**
102
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
103
+ */
104
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
105
+ /**
106
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
107
+ */
108
+ class Func_void_std__exception_ptr_Wrapper final {
109
+ public:
110
+ 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))) {}
111
+ inline void call(std::exception_ptr error) const noexcept {
112
+ _function->operator()(error);
113
+ }
114
+ private:
115
+ std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
116
+ } SWIFT_NONCOPYABLE;
117
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
118
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
119
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
120
+ }
121
+
122
+ // pragma MARK: std::optional<PushEnvironment>
123
+ /**
124
+ * Specialized version of `std::optional<PushEnvironment>`.
125
+ */
126
+ using std__optional_PushEnvironment_ = std::optional<PushEnvironment>;
127
+ inline std::optional<PushEnvironment> create_std__optional_PushEnvironment_(const PushEnvironment& value) noexcept {
128
+ return std::optional<PushEnvironment>(value);
129
+ }
130
+ inline bool has_value_std__optional_PushEnvironment_(const std::optional<PushEnvironment>& optional) noexcept {
131
+ return optional.has_value();
132
+ }
133
+ inline PushEnvironment get_std__optional_PushEnvironment_(const std::optional<PushEnvironment>& optional) noexcept {
134
+ return optional.value();
135
+ }
136
+
137
+ // pragma MARK: std::shared_ptr<Promise<PushCredentials>>
138
+ /**
139
+ * Specialized version of `std::shared_ptr<Promise<PushCredentials>>`.
140
+ */
141
+ using std__shared_ptr_Promise_PushCredentials__ = std::shared_ptr<Promise<PushCredentials>>;
142
+ inline std::shared_ptr<Promise<PushCredentials>> create_std__shared_ptr_Promise_PushCredentials__() noexcept {
143
+ return Promise<PushCredentials>::create();
144
+ }
145
+ inline PromiseHolder<PushCredentials> wrap_std__shared_ptr_Promise_PushCredentials__(std::shared_ptr<Promise<PushCredentials>> promise) noexcept {
146
+ return PromiseHolder<PushCredentials>(std::move(promise));
147
+ }
148
+
149
+ // pragma MARK: std::function<void(const PushCredentials& /* result */)>
150
+ /**
151
+ * Specialized version of `std::function<void(const PushCredentials&)>`.
152
+ */
153
+ using Func_void_PushCredentials = std::function<void(const PushCredentials& /* result */)>;
154
+ /**
155
+ * Wrapper class for a `std::function<void(const PushCredentials& / * result * /)>`, this can be used from Swift.
156
+ */
157
+ class Func_void_PushCredentials_Wrapper final {
158
+ public:
159
+ explicit Func_void_PushCredentials_Wrapper(std::function<void(const PushCredentials& /* result */)>&& func): _function(std::make_unique<std::function<void(const PushCredentials& /* result */)>>(std::move(func))) {}
160
+ inline void call(PushCredentials result) const noexcept {
161
+ _function->operator()(result);
162
+ }
163
+ private:
164
+ std::unique_ptr<std::function<void(const PushCredentials& /* result */)>> _function;
165
+ } SWIFT_NONCOPYABLE;
166
+ Func_void_PushCredentials create_Func_void_PushCredentials(void* NON_NULL swiftClosureWrapper) noexcept;
167
+ inline Func_void_PushCredentials_Wrapper wrap_Func_void_PushCredentials(Func_void_PushCredentials value) noexcept {
168
+ return Func_void_PushCredentials_Wrapper(std::move(value));
169
+ }
170
+
171
+ // pragma MARK: std::unordered_map<std::string, std::string>
172
+ /**
173
+ * Specialized version of `std::unordered_map<std::string, std::string>`.
174
+ */
175
+ using std__unordered_map_std__string__std__string_ = std::unordered_map<std::string, std::string>;
176
+ inline std::unordered_map<std::string, std::string> create_std__unordered_map_std__string__std__string_(size_t size) noexcept {
177
+ std::unordered_map<std::string, std::string> map;
178
+ map.reserve(size);
179
+ return map;
180
+ }
181
+ inline std::vector<std::string> get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) noexcept {
182
+ std::vector<std::string> keys;
183
+ keys.reserve(map.size());
184
+ for (const auto& entry : map) {
185
+ keys.push_back(entry.first);
186
+ }
187
+ return keys;
188
+ }
189
+ inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) noexcept {
190
+ return map.find(key)->second;
191
+ }
192
+ inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) noexcept {
193
+ map.emplace(key, value);
194
+ }
195
+
196
+ // pragma MARK: std::function<void(const PushMessage& /* message */)>
197
+ /**
198
+ * Specialized version of `std::function<void(const PushMessage&)>`.
199
+ */
200
+ using Func_void_PushMessage = std::function<void(const PushMessage& /* message */)>;
201
+ /**
202
+ * Wrapper class for a `std::function<void(const PushMessage& / * message * /)>`, this can be used from Swift.
203
+ */
204
+ class Func_void_PushMessage_Wrapper final {
205
+ public:
206
+ explicit Func_void_PushMessage_Wrapper(std::function<void(const PushMessage& /* message */)>&& func): _function(std::make_unique<std::function<void(const PushMessage& /* message */)>>(std::move(func))) {}
207
+ inline void call(PushMessage message) const noexcept {
208
+ _function->operator()(message);
209
+ }
210
+ private:
211
+ std::unique_ptr<std::function<void(const PushMessage& /* message */)>> _function;
212
+ } SWIFT_NONCOPYABLE;
213
+ Func_void_PushMessage create_Func_void_PushMessage(void* NON_NULL swiftClosureWrapper) noexcept;
214
+ inline Func_void_PushMessage_Wrapper wrap_Func_void_PushMessage(Func_void_PushMessage value) noexcept {
215
+ return Func_void_PushMessage_Wrapper(std::move(value));
216
+ }
217
+
218
+ // pragma MARK: std::shared_ptr<HybridPushSignalSpec>
219
+ /**
220
+ * Specialized version of `std::shared_ptr<HybridPushSignalSpec>`.
221
+ */
222
+ using std__shared_ptr_HybridPushSignalSpec_ = std::shared_ptr<HybridPushSignalSpec>;
223
+ std::shared_ptr<HybridPushSignalSpec> create_std__shared_ptr_HybridPushSignalSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
224
+ void* NON_NULL get_std__shared_ptr_HybridPushSignalSpec_(std__shared_ptr_HybridPushSignalSpec_ cppType);
225
+
226
+ // pragma MARK: std::weak_ptr<HybridPushSignalSpec>
227
+ using std__weak_ptr_HybridPushSignalSpec_ = std::weak_ptr<HybridPushSignalSpec>;
228
+ inline std__weak_ptr_HybridPushSignalSpec_ weakify_std__shared_ptr_HybridPushSignalSpec_(const std::shared_ptr<HybridPushSignalSpec>& strong) noexcept { return strong; }
229
+
230
+ // pragma MARK: Result<void>
231
+ using Result_void_ = Result<void>;
232
+ inline Result_void_ create_Result_void_() noexcept {
233
+ return Result<void>::withValue();
234
+ }
235
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
236
+ return Result<void>::withError(error);
237
+ }
238
+
239
+ // pragma MARK: Result<std::shared_ptr<Promise<PermissionStatus>>>
240
+ using Result_std__shared_ptr_Promise_PermissionStatus___ = Result<std::shared_ptr<Promise<PermissionStatus>>>;
241
+ inline Result_std__shared_ptr_Promise_PermissionStatus___ create_Result_std__shared_ptr_Promise_PermissionStatus___(const std::shared_ptr<Promise<PermissionStatus>>& value) noexcept {
242
+ return Result<std::shared_ptr<Promise<PermissionStatus>>>::withValue(value);
243
+ }
244
+ inline Result_std__shared_ptr_Promise_PermissionStatus___ create_Result_std__shared_ptr_Promise_PermissionStatus___(const std::exception_ptr& error) noexcept {
245
+ return Result<std::shared_ptr<Promise<PermissionStatus>>>::withError(error);
246
+ }
247
+
248
+ // pragma MARK: Result<std::shared_ptr<Promise<PushCredentials>>>
249
+ using Result_std__shared_ptr_Promise_PushCredentials___ = Result<std::shared_ptr<Promise<PushCredentials>>>;
250
+ inline Result_std__shared_ptr_Promise_PushCredentials___ create_Result_std__shared_ptr_Promise_PushCredentials___(const std::shared_ptr<Promise<PushCredentials>>& value) noexcept {
251
+ return Result<std::shared_ptr<Promise<PushCredentials>>>::withValue(value);
252
+ }
253
+ inline Result_std__shared_ptr_Promise_PushCredentials___ create_Result_std__shared_ptr_Promise_PushCredentials___(const std::exception_ptr& error) noexcept {
254
+ return Result<std::shared_ptr<Promise<PushCredentials>>>::withError(error);
255
+ }
256
+
257
+ } // namespace margelo::nitro::pushsignal::bridge::swift
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// PushSignal-Swift-Cxx-Umbrella.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `AndroidFirebaseConfig` to properly resolve imports.
12
+ namespace margelo::nitro::pushsignal { struct AndroidFirebaseConfig; }
13
+ // Forward declaration of `HybridPushSignalSpec` to properly resolve imports.
14
+ namespace margelo::nitro::pushsignal { class HybridPushSignalSpec; }
15
+ // Forward declaration of `PermissionStatus` to properly resolve imports.
16
+ namespace margelo::nitro::pushsignal { enum class PermissionStatus; }
17
+ // Forward declaration of `PushCredentials` to properly resolve imports.
18
+ namespace margelo::nitro::pushsignal { struct PushCredentials; }
19
+ // Forward declaration of `PushEnvironment` to properly resolve imports.
20
+ namespace margelo::nitro::pushsignal { enum class PushEnvironment; }
21
+ // Forward declaration of `PushMessage` to properly resolve imports.
22
+ namespace margelo::nitro::pushsignal { struct PushMessage; }
23
+ // Forward declaration of `PushPlatform` to properly resolve imports.
24
+ namespace margelo::nitro::pushsignal { enum class PushPlatform; }
25
+
26
+ // Include C++ defined types
27
+ #include "AndroidFirebaseConfig.hpp"
28
+ #include "HybridPushSignalSpec.hpp"
29
+ #include "PermissionStatus.hpp"
30
+ #include "PushCredentials.hpp"
31
+ #include "PushEnvironment.hpp"
32
+ #include "PushMessage.hpp"
33
+ #include "PushPlatform.hpp"
34
+ #include <NitroModules/Promise.hpp>
35
+ #include <NitroModules/Result.hpp>
36
+ #include <exception>
37
+ #include <functional>
38
+ #include <memory>
39
+ #include <optional>
40
+ #include <string>
41
+ #include <unordered_map>
42
+
43
+ // C++ helpers for Swift
44
+ #include "PushSignal-Swift-Cxx-Bridge.hpp"
45
+
46
+ // Common C++ types used in Swift
47
+ #include <NitroModules/ArrayBufferHolder.hpp>
48
+ #include <NitroModules/AnyMapUtils.hpp>
49
+ #include <NitroModules/RuntimeError.hpp>
50
+ #include <NitroModules/DateToChronoDate.hpp>
51
+
52
+ // Forward declarations of Swift defined types
53
+ // Forward declaration of `HybridPushSignalSpec_cxx` to properly resolve imports.
54
+ namespace PushSignal { class HybridPushSignalSpec_cxx; }
55
+
56
+ // Include Swift defined types
57
+ #if __has_include("PushSignal-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 "PushSignal".
60
+ #include "PushSignal-Swift.h"
61
+ // Same as above, but used when building with frameworks (`use_frameworks`)
62
+ #elif __has_include(<PushSignal/PushSignal-Swift.h>)
63
+ #include <PushSignal/PushSignal-Swift.h>
64
+ #else
65
+ #error PushSignal's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "PushSignal", and try building the app first.
66
+ #endif
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// PushSignalAutolinking.mm
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <NitroModules/HybridObjectRegistry.hpp>
10
+ #import "PushSignal-Swift-Cxx-Umbrella.hpp"
11
+ #import <type_traits>
12
+
13
+ #include "HybridPushSignalSpecSwift.hpp"
14
+
15
+ @interface PushSignalAutolinking : NSObject
16
+ @end
17
+
18
+ @implementation PushSignalAutolinking
19
+
20
+ + (void) load {
21
+ using namespace margelo::nitro;
22
+ using namespace margelo::nitro::pushsignal;
23
+
24
+ HybridObjectRegistry::registerHybridObjectConstructor(
25
+ "PushSignal",
26
+ []() -> std::shared_ptr<HybridObject> {
27
+ std::shared_ptr<HybridPushSignalSpec> hybridObject = PushSignal::PushSignalAutolinking::createPushSignal();
28
+ return hybridObject;
29
+ }
30
+ );
31
+ }
32
+
33
+ @end
@@ -0,0 +1,26 @@
1
+ ///
2
+ /// PushSignalAutolinking.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
12
+ public final class PushSignalAutolinking {
13
+ public typealias bridge = margelo.nitro.pushsignal.bridge.swift
14
+
15
+ public static func createPushSignal() -> bridge.std__shared_ptr_HybridPushSignalSpec_ {
16
+ let hybridObject = PushSignal()
17
+ return { () -> bridge.std__shared_ptr_HybridPushSignalSpec_ in
18
+ let __cxxWrapped = hybridObject.getCxxWrapper()
19
+ return __cxxWrapped.getCxxPart()
20
+ }()
21
+ }
22
+
23
+ public static func isPushSignalRecyclable() -> Bool {
24
+ return PushSignal.self is any RecyclableView.Type
25
+ }
26
+ }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridPushSignalSpecSwift.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridPushSignalSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::pushsignal {
11
+ } // namespace margelo::nitro::pushsignal