react-native-push-signal 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/PushSignal.podspec +2 -12
- package/README.md +1 -3
- package/README.ru.md +1 -3
- package/android/build.gradle +1 -62
- package/android/consumer-rules.pro +3 -3
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/pushsignal/PushModels.kt +15 -0
- package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalCenter.kt +2 -3
- package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalInitProvider.kt +1 -1
- package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalMessagingService.kt +1 -1
- package/android/src/main/java/com/pushsignal/PushSignalModule.kt +88 -0
- package/android/src/main/java/com/pushsignal/PushSignalPackage.kt +30 -0
- package/ios/PushSignal.h +4 -0
- package/ios/PushSignal.mm +57 -0
- package/ios/PushSignalCenter.h +26 -0
- package/ios/PushSignalCenter.m +583 -0
- package/ios/PushSignalLaunchStore.m +3 -14
- package/lib/module/NativePushSignal.js +5 -0
- package/lib/module/NativePushSignal.js.map +1 -0
- package/lib/module/pushSignal.native.js +33 -7
- package/lib/module/pushSignal.native.js.map +1 -1
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/NativePushSignal.d.ts +22 -0
- package/lib/typescript/src/NativePushSignal.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/pushSignal.d.ts +1 -1
- package/lib/typescript/src/pushSignal.d.ts.map +1 -1
- package/lib/typescript/src/pushSignal.native.d.ts +1 -1
- package/lib/typescript/src/pushSignal.native.d.ts.map +1 -1
- package/lib/typescript/src/{PushSignal.nitro.d.ts → types.d.ts} +2 -12
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +14 -19
- package/src/NativePushSignal.ts +25 -0
- package/src/index.tsx +1 -1
- package/src/pushSignal.native.tsx +54 -11
- package/src/pushSignal.tsx +1 -1
- package/src/types.ts +25 -0
- package/android/CMakeLists.txt +0 -24
- package/android/src/main/cpp/cpp-adapter.cpp +0 -11
- package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignal.kt +0 -38
- package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalPackage.kt +0 -22
- package/ios/PushSignal.swift +0 -29
- package/ios/PushSignalCenter.swift +0 -604
- package/lib/module/PushSignal.nitro.js +0 -4
- package/lib/module/PushSignal.nitro.js.map +0 -1
- package/lib/typescript/src/PushSignal.nitro.d.ts.map +0 -1
- package/nitro.json +0 -23
- package/nitrogen/generated/android/c++/JAndroidFirebaseConfig.hpp +0 -70
- package/nitrogen/generated/android/c++/JFunc_void_PushMessage.hpp +0 -80
- package/nitrogen/generated/android/c++/JHybridPushSignalSpec.cpp +0 -114
- package/nitrogen/generated/android/c++/JHybridPushSignalSpec.hpp +0 -66
- package/nitrogen/generated/android/c++/JPushCredentials.hpp +0 -70
- package/nitrogen/generated/android/c++/JPushEnvironment.hpp +0 -58
- package/nitrogen/generated/android/c++/JPushMessage.hpp +0 -84
- package/nitrogen/generated/android/c++/JPushPlatform.hpp +0 -58
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/AndroidFirebaseConfig.kt +0 -66
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/Func_void_PushMessage.kt +0 -78
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/HybridPushSignalSpec.kt +0 -79
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushCredentials.kt +0 -61
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushEnvironment.kt +0 -23
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushMessage.kt +0 -66
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushPlatform.kt +0 -23
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/pushsignalOnLoad.kt +0 -35
- package/nitrogen/generated/android/pushsignal+autolinking.cmake +0 -81
- package/nitrogen/generated/android/pushsignal+autolinking.gradle +0 -27
- package/nitrogen/generated/android/pushsignalOnLoad.cpp +0 -56
- package/nitrogen/generated/android/pushsignalOnLoad.hpp +0 -34
- package/nitrogen/generated/ios/PushSignal+autolinking.rb +0 -62
- package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.cpp +0 -65
- package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.hpp +0 -254
- package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Umbrella.hpp +0 -63
- package/nitrogen/generated/ios/PushSignalAutolinking.mm +0 -33
- package/nitrogen/generated/ios/PushSignalAutolinking.swift +0 -26
- package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.hpp +0 -120
- package/nitrogen/generated/ios/swift/AndroidFirebaseConfig.swift +0 -96
- package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_PushCredentials.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_PushMessage.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridPushSignalSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridPushSignalSpec_cxx.swift +0 -196
- package/nitrogen/generated/ios/swift/PushCredentials.swift +0 -45
- package/nitrogen/generated/ios/swift/PushEnvironment.swift +0 -40
- package/nitrogen/generated/ios/swift/PushMessage.swift +0 -97
- package/nitrogen/generated/ios/swift/PushPlatform.swift +0 -40
- package/nitrogen/generated/shared/c++/AndroidFirebaseConfig.hpp +0 -96
- package/nitrogen/generated/shared/c++/HybridPushSignalSpec.cpp +0 -24
- package/nitrogen/generated/shared/c++/HybridPushSignalSpec.hpp +0 -74
- package/nitrogen/generated/shared/c++/PushCredentials.hpp +0 -97
- package/nitrogen/generated/shared/c++/PushEnvironment.hpp +0 -76
- package/nitrogen/generated/shared/c++/PushMessage.hpp +0 -97
- package/nitrogen/generated/shared/c++/PushPlatform.hpp +0 -76
- package/src/PushSignal.nitro.ts +0 -39
|
@@ -1,254 +0,0 @@
|
|
|
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 `PushCredentials` to properly resolve imports.
|
|
14
|
-
namespace margelo::nitro::pushsignal { struct PushCredentials; }
|
|
15
|
-
// Forward declaration of `PushEnvironment` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::pushsignal { enum class PushEnvironment; }
|
|
17
|
-
// Forward declaration of `PushMessage` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::pushsignal { struct PushMessage; }
|
|
19
|
-
// Forward declaration of `PushPlatform` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::pushsignal { enum class PushPlatform; }
|
|
21
|
-
|
|
22
|
-
// Forward declarations of Swift defined types
|
|
23
|
-
// Forward declaration of `HybridPushSignalSpec_cxx` to properly resolve imports.
|
|
24
|
-
namespace PushSignal { class HybridPushSignalSpec_cxx; }
|
|
25
|
-
|
|
26
|
-
// Include C++ defined types
|
|
27
|
-
#include "HybridPushSignalSpec.hpp"
|
|
28
|
-
#include "PushCredentials.hpp"
|
|
29
|
-
#include "PushEnvironment.hpp"
|
|
30
|
-
#include "PushMessage.hpp"
|
|
31
|
-
#include "PushPlatform.hpp"
|
|
32
|
-
#include <NitroModules/Promise.hpp>
|
|
33
|
-
#include <NitroModules/PromiseHolder.hpp>
|
|
34
|
-
#include <NitroModules/Result.hpp>
|
|
35
|
-
#include <exception>
|
|
36
|
-
#include <functional>
|
|
37
|
-
#include <memory>
|
|
38
|
-
#include <optional>
|
|
39
|
-
#include <string>
|
|
40
|
-
#include <unordered_map>
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
44
|
-
* as well as helper functions to interact with those C++ types from Swift.
|
|
45
|
-
*/
|
|
46
|
-
namespace margelo::nitro::pushsignal::bridge::swift {
|
|
47
|
-
|
|
48
|
-
// pragma MARK: std::shared_ptr<Promise<void>>
|
|
49
|
-
/**
|
|
50
|
-
* Specialized version of `std::shared_ptr<Promise<void>>`.
|
|
51
|
-
*/
|
|
52
|
-
using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
|
|
53
|
-
inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
|
|
54
|
-
return Promise<void>::create();
|
|
55
|
-
}
|
|
56
|
-
inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
|
|
57
|
-
return PromiseHolder<void>(std::move(promise));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// pragma MARK: std::function<void()>
|
|
61
|
-
/**
|
|
62
|
-
* Specialized version of `std::function<void()>`.
|
|
63
|
-
*/
|
|
64
|
-
using Func_void = std::function<void()>;
|
|
65
|
-
/**
|
|
66
|
-
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
67
|
-
*/
|
|
68
|
-
class Func_void_Wrapper final {
|
|
69
|
-
public:
|
|
70
|
-
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
71
|
-
inline void call() const noexcept {
|
|
72
|
-
_function->operator()();
|
|
73
|
-
}
|
|
74
|
-
private:
|
|
75
|
-
std::unique_ptr<std::function<void()>> _function;
|
|
76
|
-
} SWIFT_NONCOPYABLE;
|
|
77
|
-
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
78
|
-
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
79
|
-
return Func_void_Wrapper(std::move(value));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
83
|
-
/**
|
|
84
|
-
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
85
|
-
*/
|
|
86
|
-
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
87
|
-
/**
|
|
88
|
-
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
89
|
-
*/
|
|
90
|
-
class Func_void_std__exception_ptr_Wrapper final {
|
|
91
|
-
public:
|
|
92
|
-
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))) {}
|
|
93
|
-
inline void call(std::exception_ptr error) const noexcept {
|
|
94
|
-
_function->operator()(error);
|
|
95
|
-
}
|
|
96
|
-
private:
|
|
97
|
-
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
98
|
-
} SWIFT_NONCOPYABLE;
|
|
99
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
100
|
-
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
101
|
-
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// pragma MARK: std::optional<std::string>
|
|
105
|
-
/**
|
|
106
|
-
* Specialized version of `std::optional<std::string>`.
|
|
107
|
-
*/
|
|
108
|
-
using std__optional_std__string_ = std::optional<std::string>;
|
|
109
|
-
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
110
|
-
return std::optional<std::string>(value);
|
|
111
|
-
}
|
|
112
|
-
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
113
|
-
return optional.has_value();
|
|
114
|
-
}
|
|
115
|
-
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
116
|
-
return optional.value();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// pragma MARK: std::optional<PushEnvironment>
|
|
120
|
-
/**
|
|
121
|
-
* Specialized version of `std::optional<PushEnvironment>`.
|
|
122
|
-
*/
|
|
123
|
-
using std__optional_PushEnvironment_ = std::optional<PushEnvironment>;
|
|
124
|
-
inline std::optional<PushEnvironment> create_std__optional_PushEnvironment_(const PushEnvironment& value) noexcept {
|
|
125
|
-
return std::optional<PushEnvironment>(value);
|
|
126
|
-
}
|
|
127
|
-
inline bool has_value_std__optional_PushEnvironment_(const std::optional<PushEnvironment>& optional) noexcept {
|
|
128
|
-
return optional.has_value();
|
|
129
|
-
}
|
|
130
|
-
inline PushEnvironment get_std__optional_PushEnvironment_(const std::optional<PushEnvironment>& optional) noexcept {
|
|
131
|
-
return optional.value();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// pragma MARK: std::shared_ptr<Promise<PushCredentials>>
|
|
135
|
-
/**
|
|
136
|
-
* Specialized version of `std::shared_ptr<Promise<PushCredentials>>`.
|
|
137
|
-
*/
|
|
138
|
-
using std__shared_ptr_Promise_PushCredentials__ = std::shared_ptr<Promise<PushCredentials>>;
|
|
139
|
-
inline std::shared_ptr<Promise<PushCredentials>> create_std__shared_ptr_Promise_PushCredentials__() noexcept {
|
|
140
|
-
return Promise<PushCredentials>::create();
|
|
141
|
-
}
|
|
142
|
-
inline PromiseHolder<PushCredentials> wrap_std__shared_ptr_Promise_PushCredentials__(std::shared_ptr<Promise<PushCredentials>> promise) noexcept {
|
|
143
|
-
return PromiseHolder<PushCredentials>(std::move(promise));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// pragma MARK: std::function<void(const PushCredentials& /* result */)>
|
|
147
|
-
/**
|
|
148
|
-
* Specialized version of `std::function<void(const PushCredentials&)>`.
|
|
149
|
-
*/
|
|
150
|
-
using Func_void_PushCredentials = std::function<void(const PushCredentials& /* result */)>;
|
|
151
|
-
/**
|
|
152
|
-
* Wrapper class for a `std::function<void(const PushCredentials& / * result * /)>`, this can be used from Swift.
|
|
153
|
-
*/
|
|
154
|
-
class Func_void_PushCredentials_Wrapper final {
|
|
155
|
-
public:
|
|
156
|
-
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))) {}
|
|
157
|
-
inline void call(PushCredentials result) const noexcept {
|
|
158
|
-
_function->operator()(result);
|
|
159
|
-
}
|
|
160
|
-
private:
|
|
161
|
-
std::unique_ptr<std::function<void(const PushCredentials& /* result */)>> _function;
|
|
162
|
-
} SWIFT_NONCOPYABLE;
|
|
163
|
-
Func_void_PushCredentials create_Func_void_PushCredentials(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
164
|
-
inline Func_void_PushCredentials_Wrapper wrap_Func_void_PushCredentials(Func_void_PushCredentials value) noexcept {
|
|
165
|
-
return Func_void_PushCredentials_Wrapper(std::move(value));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// pragma MARK: std::unordered_map<std::string, std::string>
|
|
169
|
-
/**
|
|
170
|
-
* Specialized version of `std::unordered_map<std::string, std::string>`.
|
|
171
|
-
*/
|
|
172
|
-
using std__unordered_map_std__string__std__string_ = std::unordered_map<std::string, std::string>;
|
|
173
|
-
inline std::unordered_map<std::string, std::string> create_std__unordered_map_std__string__std__string_(size_t size) noexcept {
|
|
174
|
-
std::unordered_map<std::string, std::string> map;
|
|
175
|
-
map.reserve(size);
|
|
176
|
-
return map;
|
|
177
|
-
}
|
|
178
|
-
inline std::vector<std::string> get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) noexcept {
|
|
179
|
-
std::vector<std::string> keys;
|
|
180
|
-
keys.reserve(map.size());
|
|
181
|
-
for (const auto& entry : map) {
|
|
182
|
-
keys.push_back(entry.first);
|
|
183
|
-
}
|
|
184
|
-
return keys;
|
|
185
|
-
}
|
|
186
|
-
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 {
|
|
187
|
-
return map.find(key)->second;
|
|
188
|
-
}
|
|
189
|
-
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 {
|
|
190
|
-
map.emplace(key, value);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// pragma MARK: std::function<void(const PushMessage& /* message */)>
|
|
194
|
-
/**
|
|
195
|
-
* Specialized version of `std::function<void(const PushMessage&)>`.
|
|
196
|
-
*/
|
|
197
|
-
using Func_void_PushMessage = std::function<void(const PushMessage& /* message */)>;
|
|
198
|
-
/**
|
|
199
|
-
* Wrapper class for a `std::function<void(const PushMessage& / * message * /)>`, this can be used from Swift.
|
|
200
|
-
*/
|
|
201
|
-
class Func_void_PushMessage_Wrapper final {
|
|
202
|
-
public:
|
|
203
|
-
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))) {}
|
|
204
|
-
inline void call(PushMessage message) const noexcept {
|
|
205
|
-
_function->operator()(message);
|
|
206
|
-
}
|
|
207
|
-
private:
|
|
208
|
-
std::unique_ptr<std::function<void(const PushMessage& /* message */)>> _function;
|
|
209
|
-
} SWIFT_NONCOPYABLE;
|
|
210
|
-
Func_void_PushMessage create_Func_void_PushMessage(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
211
|
-
inline Func_void_PushMessage_Wrapper wrap_Func_void_PushMessage(Func_void_PushMessage value) noexcept {
|
|
212
|
-
return Func_void_PushMessage_Wrapper(std::move(value));
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// pragma MARK: std::shared_ptr<HybridPushSignalSpec>
|
|
216
|
-
/**
|
|
217
|
-
* Specialized version of `std::shared_ptr<HybridPushSignalSpec>`.
|
|
218
|
-
*/
|
|
219
|
-
using std__shared_ptr_HybridPushSignalSpec_ = std::shared_ptr<HybridPushSignalSpec>;
|
|
220
|
-
std::shared_ptr<HybridPushSignalSpec> create_std__shared_ptr_HybridPushSignalSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
221
|
-
void* NON_NULL get_std__shared_ptr_HybridPushSignalSpec_(std__shared_ptr_HybridPushSignalSpec_ cppType);
|
|
222
|
-
|
|
223
|
-
// pragma MARK: std::weak_ptr<HybridPushSignalSpec>
|
|
224
|
-
using std__weak_ptr_HybridPushSignalSpec_ = std::weak_ptr<HybridPushSignalSpec>;
|
|
225
|
-
inline std__weak_ptr_HybridPushSignalSpec_ weakify_std__shared_ptr_HybridPushSignalSpec_(const std::shared_ptr<HybridPushSignalSpec>& strong) noexcept { return strong; }
|
|
226
|
-
|
|
227
|
-
// pragma MARK: Result<std::shared_ptr<Promise<void>>>
|
|
228
|
-
using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
|
|
229
|
-
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
|
|
230
|
-
return Result<std::shared_ptr<Promise<void>>>::withValue(value);
|
|
231
|
-
}
|
|
232
|
-
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
|
|
233
|
-
return Result<std::shared_ptr<Promise<void>>>::withError(error);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// pragma MARK: Result<std::shared_ptr<Promise<PushCredentials>>>
|
|
237
|
-
using Result_std__shared_ptr_Promise_PushCredentials___ = Result<std::shared_ptr<Promise<PushCredentials>>>;
|
|
238
|
-
inline Result_std__shared_ptr_Promise_PushCredentials___ create_Result_std__shared_ptr_Promise_PushCredentials___(const std::shared_ptr<Promise<PushCredentials>>& value) noexcept {
|
|
239
|
-
return Result<std::shared_ptr<Promise<PushCredentials>>>::withValue(value);
|
|
240
|
-
}
|
|
241
|
-
inline Result_std__shared_ptr_Promise_PushCredentials___ create_Result_std__shared_ptr_Promise_PushCredentials___(const std::exception_ptr& error) noexcept {
|
|
242
|
-
return Result<std::shared_ptr<Promise<PushCredentials>>>::withError(error);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// pragma MARK: Result<void>
|
|
246
|
-
using Result_void_ = Result<void>;
|
|
247
|
-
inline Result_void_ create_Result_void_() noexcept {
|
|
248
|
-
return Result<void>::withValue();
|
|
249
|
-
}
|
|
250
|
-
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
251
|
-
return Result<void>::withError(error);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
} // namespace margelo::nitro::pushsignal::bridge::swift
|
|
@@ -1,63 +0,0 @@
|
|
|
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 `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
|
-
// Include C++ defined types
|
|
25
|
-
#include "AndroidFirebaseConfig.hpp"
|
|
26
|
-
#include "HybridPushSignalSpec.hpp"
|
|
27
|
-
#include "PushCredentials.hpp"
|
|
28
|
-
#include "PushEnvironment.hpp"
|
|
29
|
-
#include "PushMessage.hpp"
|
|
30
|
-
#include "PushPlatform.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
|
-
#include <unordered_map>
|
|
39
|
-
|
|
40
|
-
// C++ helpers for Swift
|
|
41
|
-
#include "PushSignal-Swift-Cxx-Bridge.hpp"
|
|
42
|
-
|
|
43
|
-
// Common C++ types used in Swift
|
|
44
|
-
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
45
|
-
#include <NitroModules/AnyMapUtils.hpp>
|
|
46
|
-
#include <NitroModules/RuntimeError.hpp>
|
|
47
|
-
#include <NitroModules/DateToChronoDate.hpp>
|
|
48
|
-
|
|
49
|
-
// Forward declarations of Swift defined types
|
|
50
|
-
// Forward declaration of `HybridPushSignalSpec_cxx` to properly resolve imports.
|
|
51
|
-
namespace PushSignal { class HybridPushSignalSpec_cxx; }
|
|
52
|
-
|
|
53
|
-
// Include Swift defined types
|
|
54
|
-
#if __has_include("PushSignal-Swift.h")
|
|
55
|
-
// This header is generated by Xcode/Swift on every app build.
|
|
56
|
-
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "PushSignal".
|
|
57
|
-
#include "PushSignal-Swift.h"
|
|
58
|
-
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
59
|
-
#elif __has_include(<PushSignal/PushSignal-Swift.h>)
|
|
60
|
-
#include <PushSignal/PushSignal-Swift.h>
|
|
61
|
-
#else
|
|
62
|
-
#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.
|
|
63
|
-
#endif
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridPushSignalSpecSwift.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
|
-
#include "HybridPushSignalSpec.hpp"
|
|
11
|
-
|
|
12
|
-
// Forward declaration of `HybridPushSignalSpec_cxx` to properly resolve imports.
|
|
13
|
-
namespace PushSignal { class HybridPushSignalSpec_cxx; }
|
|
14
|
-
|
|
15
|
-
// Forward declaration of `AndroidFirebaseConfig` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::pushsignal { struct AndroidFirebaseConfig; }
|
|
17
|
-
// Forward declaration of `PushCredentials` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::pushsignal { struct PushCredentials; }
|
|
19
|
-
// Forward declaration of `PushPlatform` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::pushsignal { enum class PushPlatform; }
|
|
21
|
-
// Forward declaration of `PushEnvironment` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::pushsignal { enum class PushEnvironment; }
|
|
23
|
-
// Forward declaration of `PushMessage` to properly resolve imports.
|
|
24
|
-
namespace margelo::nitro::pushsignal { struct PushMessage; }
|
|
25
|
-
|
|
26
|
-
#include <NitroModules/Promise.hpp>
|
|
27
|
-
#include "AndroidFirebaseConfig.hpp"
|
|
28
|
-
#include <string>
|
|
29
|
-
#include <optional>
|
|
30
|
-
#include "PushCredentials.hpp"
|
|
31
|
-
#include "PushPlatform.hpp"
|
|
32
|
-
#include "PushEnvironment.hpp"
|
|
33
|
-
#include "PushMessage.hpp"
|
|
34
|
-
#include <functional>
|
|
35
|
-
#include <unordered_map>
|
|
36
|
-
|
|
37
|
-
#include "PushSignal-Swift-Cxx-Umbrella.hpp"
|
|
38
|
-
|
|
39
|
-
namespace margelo::nitro::pushsignal {
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The C++ part of HybridPushSignalSpec_cxx.swift.
|
|
43
|
-
*
|
|
44
|
-
* HybridPushSignalSpecSwift (C++) accesses HybridPushSignalSpec_cxx (Swift), and might
|
|
45
|
-
* contain some additional bridging code for C++ <> Swift interop.
|
|
46
|
-
*
|
|
47
|
-
* Since this obviously introduces an overhead, I hope at some point in
|
|
48
|
-
* the future, HybridPushSignalSpec_cxx can directly inherit from the C++ class HybridPushSignalSpec
|
|
49
|
-
* to simplify the whole structure and memory management.
|
|
50
|
-
*/
|
|
51
|
-
class HybridPushSignalSpecSwift: public virtual HybridPushSignalSpec {
|
|
52
|
-
public:
|
|
53
|
-
// Constructor from a Swift instance
|
|
54
|
-
explicit HybridPushSignalSpecSwift(const PushSignal::HybridPushSignalSpec_cxx& swiftPart):
|
|
55
|
-
HybridObject(HybridPushSignalSpec::TAG),
|
|
56
|
-
_swiftPart(swiftPart) { }
|
|
57
|
-
|
|
58
|
-
public:
|
|
59
|
-
// Get the Swift part
|
|
60
|
-
inline PushSignal::HybridPushSignalSpec_cxx& getSwiftPart() noexcept {
|
|
61
|
-
return _swiftPart;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public:
|
|
65
|
-
inline size_t getExternalMemorySize() noexcept override {
|
|
66
|
-
return _swiftPart.getMemorySize();
|
|
67
|
-
}
|
|
68
|
-
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
69
|
-
if (auto otherCast = std::dynamic_pointer_cast<HybridPushSignalSpecSwift>(other)) {
|
|
70
|
-
return _swiftPart.equals(otherCast->_swiftPart);
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
void dispose() noexcept override {
|
|
75
|
-
_swiftPart.dispose();
|
|
76
|
-
}
|
|
77
|
-
std::string toString() override {
|
|
78
|
-
return _swiftPart.toString();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public:
|
|
82
|
-
// Properties
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
public:
|
|
86
|
-
// Methods
|
|
87
|
-
inline std::shared_ptr<Promise<void>> initialize(const AndroidFirebaseConfig& config) override {
|
|
88
|
-
auto __result = _swiftPart.initialize(std::forward<decltype(config)>(config));
|
|
89
|
-
if (__result.hasError()) [[unlikely]] {
|
|
90
|
-
std::rethrow_exception(__result.error());
|
|
91
|
-
}
|
|
92
|
-
auto __value = std::move(__result.value());
|
|
93
|
-
return __value;
|
|
94
|
-
}
|
|
95
|
-
inline std::shared_ptr<Promise<PushCredentials>> getCredentials() override {
|
|
96
|
-
auto __result = _swiftPart.getCredentials();
|
|
97
|
-
if (__result.hasError()) [[unlikely]] {
|
|
98
|
-
std::rethrow_exception(__result.error());
|
|
99
|
-
}
|
|
100
|
-
auto __value = std::move(__result.value());
|
|
101
|
-
return __value;
|
|
102
|
-
}
|
|
103
|
-
inline void setOnMessage(const std::function<void(const PushMessage& /* message */)>& callback) override {
|
|
104
|
-
auto __result = _swiftPart.setOnMessage(callback);
|
|
105
|
-
if (__result.hasError()) [[unlikely]] {
|
|
106
|
-
std::rethrow_exception(__result.error());
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
inline void setOnNotificationPress(const std::function<void(const PushMessage& /* message */)>& callback) override {
|
|
110
|
-
auto __result = _swiftPart.setOnNotificationPress(callback);
|
|
111
|
-
if (__result.hasError()) [[unlikely]] {
|
|
112
|
-
std::rethrow_exception(__result.error());
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
private:
|
|
117
|
-
PushSignal::HybridPushSignalSpec_cxx _swiftPart;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
} // namespace margelo::nitro::pushsignal
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AndroidFirebaseConfig.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
|
-
/**
|
|
11
|
-
* Represents an instance of `AndroidFirebaseConfig`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias AndroidFirebaseConfig = margelo.nitro.pushsignal.AndroidFirebaseConfig
|
|
14
|
-
|
|
15
|
-
public extension AndroidFirebaseConfig {
|
|
16
|
-
private typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `AndroidFirebaseConfig`.
|
|
20
|
-
*/
|
|
21
|
-
init(project_id: String?, mobilesdk_app_id: String?, current_key: String?, project_number: String?) {
|
|
22
|
-
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
-
if let __unwrappedValue = project_id {
|
|
24
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
-
} else {
|
|
26
|
-
return .init()
|
|
27
|
-
}
|
|
28
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
29
|
-
if let __unwrappedValue = mobilesdk_app_id {
|
|
30
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
31
|
-
} else {
|
|
32
|
-
return .init()
|
|
33
|
-
}
|
|
34
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
35
|
-
if let __unwrappedValue = current_key {
|
|
36
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
37
|
-
} else {
|
|
38
|
-
return .init()
|
|
39
|
-
}
|
|
40
|
-
}(), { () -> bridge.std__optional_std__string_ in
|
|
41
|
-
if let __unwrappedValue = project_number {
|
|
42
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
43
|
-
} else {
|
|
44
|
-
return .init()
|
|
45
|
-
}
|
|
46
|
-
}())
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@inline(__always)
|
|
50
|
-
var project_id: String? {
|
|
51
|
-
return { () -> String? in
|
|
52
|
-
if bridge.has_value_std__optional_std__string_(self.__project_id) {
|
|
53
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__project_id)
|
|
54
|
-
return String(__unwrapped)
|
|
55
|
-
} else {
|
|
56
|
-
return nil
|
|
57
|
-
}
|
|
58
|
-
}()
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@inline(__always)
|
|
62
|
-
var mobilesdk_app_id: String? {
|
|
63
|
-
return { () -> String? in
|
|
64
|
-
if bridge.has_value_std__optional_std__string_(self.__mobilesdk_app_id) {
|
|
65
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__mobilesdk_app_id)
|
|
66
|
-
return String(__unwrapped)
|
|
67
|
-
} else {
|
|
68
|
-
return nil
|
|
69
|
-
}
|
|
70
|
-
}()
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@inline(__always)
|
|
74
|
-
var current_key: String? {
|
|
75
|
-
return { () -> String? in
|
|
76
|
-
if bridge.has_value_std__optional_std__string_(self.__current_key) {
|
|
77
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__current_key)
|
|
78
|
-
return String(__unwrapped)
|
|
79
|
-
} else {
|
|
80
|
-
return nil
|
|
81
|
-
}
|
|
82
|
-
}()
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@inline(__always)
|
|
86
|
-
var project_number: String? {
|
|
87
|
-
return { () -> String? in
|
|
88
|
-
if bridge.has_value_std__optional_std__string_(self.__project_number) {
|
|
89
|
-
let __unwrapped = bridge.get_std__optional_std__string_(self.__project_number)
|
|
90
|
-
return String(__unwrapped)
|
|
91
|
-
} else {
|
|
92
|
-
return nil
|
|
93
|
-
}
|
|
94
|
-
}()
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void.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
|
-
/**
|
|
11
|
-
* Wraps a Swift `() -> Void` as a class.
|
|
12
|
-
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
-
*/
|
|
14
|
-
public final class Func_void {
|
|
15
|
-
public typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
16
|
-
|
|
17
|
-
private let closure: () -> Void
|
|
18
|
-
|
|
19
|
-
public init(_ closure: @escaping () -> Void) {
|
|
20
|
-
self.closure = closure
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@inline(__always)
|
|
24
|
-
public func call() -> Void {
|
|
25
|
-
self.closure()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
-
* This acquires one additional strong reference on the object!
|
|
31
|
-
*/
|
|
32
|
-
@inline(__always)
|
|
33
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Casts an unsafe pointer to a `Func_void`.
|
|
39
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
40
|
-
* This removes one strong reference from the object!
|
|
41
|
-
*/
|
|
42
|
-
@inline(__always)
|
|
43
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
44
|
-
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
-
}
|
|
46
|
-
}
|