react-native-acoustic-connect-beta 18.0.26 → 18.0.27

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 (36) hide show
  1. package/AcousticConnectRN.podspec +4 -1
  2. package/android/src/main/assets/ConnectBasicConfig.properties +1 -1
  3. package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +54 -0
  4. package/ios/HybridAcousticConnectRN.swift +177 -0
  5. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +109 -0
  6. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
  7. package/nitrogen/generated/android/AcousticConnectRN+autolinking.cmake +1 -0
  8. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +137 -1
  9. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +7 -0
  10. package/nitrogen/generated/android/c++/JPushErrorInfo.hpp +66 -0
  11. package/nitrogen/generated/android/c++/JPushPermissionResult.hpp +66 -0
  12. package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.cpp +26 -0
  13. package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.hpp +69 -0
  14. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +30 -0
  15. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushErrorInfo.kt +44 -0
  16. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushPermissionResult.kt +41 -0
  17. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/Variant_NullType_Boolean.kt +62 -0
  18. package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.cpp +32 -0
  19. package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.hpp +249 -0
  20. package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Umbrella.hpp +8 -0
  21. package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +67 -1
  22. package/nitrogen/generated/ios/swift/Func_void_PushPermissionResult.swift +46 -0
  23. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  24. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  25. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__bool_.swift +58 -0
  26. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +7 -0
  27. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +205 -0
  28. package/nitrogen/generated/ios/swift/PushErrorInfo.swift +65 -0
  29. package/nitrogen/generated/ios/swift/PushPermissionResult.swift +66 -0
  30. package/nitrogen/generated/ios/swift/Variant_NullType_Bool.swift +30 -0
  31. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.cpp +7 -0
  32. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +15 -1
  33. package/nitrogen/generated/shared/c++/PushErrorInfo.hpp +92 -0
  34. package/nitrogen/generated/shared/c++/PushPermissionResult.hpp +90 -0
  35. package/package.json +1 -1
  36. package/src/specs/react-native-acoustic-connect.nitro.ts +128 -0
@@ -10,6 +10,10 @@
10
10
  // Forward declarations of C++ defined types
11
11
  // Forward declaration of `HybridAcousticConnectRNSpec` to properly resolve imports.
12
12
  namespace margelo::nitro::acousticconnectrn { class HybridAcousticConnectRNSpec; }
13
+ // Forward declaration of `PushErrorInfo` to properly resolve imports.
14
+ namespace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
15
+ // Forward declaration of `PushPermissionResult` to properly resolve imports.
16
+ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
13
17
 
14
18
  // Forward declarations of Swift defined types
15
19
  // Forward declaration of `HybridAcousticConnectRNSpec_cxx` to properly resolve imports.
@@ -17,9 +21,14 @@ namespace AcousticConnectRN { class HybridAcousticConnectRNSpec_cxx; }
17
21
 
18
22
  // Include C++ defined types
19
23
  #include "HybridAcousticConnectRNSpec.hpp"
24
+ #include "PushErrorInfo.hpp"
25
+ #include "PushPermissionResult.hpp"
20
26
  #include <NitroModules/Null.hpp>
27
+ #include <NitroModules/Promise.hpp>
28
+ #include <NitroModules/PromiseHolder.hpp>
21
29
  #include <NitroModules/Result.hpp>
22
30
  #include <exception>
31
+ #include <functional>
23
32
  #include <memory>
24
33
  #include <optional>
25
34
  #include <string>
@@ -136,6 +145,219 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
136
145
  map.emplace(key, value);
137
146
  }
138
147
 
148
+ // pragma MARK: std::shared_ptr<Promise<bool>>
149
+ /**
150
+ * Specialized version of `std::shared_ptr<Promise<bool>>`.
151
+ */
152
+ using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
153
+ inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
154
+ return Promise<bool>::create();
155
+ }
156
+ inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
157
+ return PromiseHolder<bool>(std::move(promise));
158
+ }
159
+
160
+ // pragma MARK: std::function<void(bool /* result */)>
161
+ /**
162
+ * Specialized version of `std::function<void(bool)>`.
163
+ */
164
+ using Func_void_bool = std::function<void(bool /* result */)>;
165
+ /**
166
+ * Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
167
+ */
168
+ class Func_void_bool_Wrapper final {
169
+ public:
170
+ explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_unique<std::function<void(bool /* result */)>>(std::move(func))) {}
171
+ inline void call(bool result) const noexcept {
172
+ _function->operator()(result);
173
+ }
174
+ private:
175
+ std::unique_ptr<std::function<void(bool /* result */)>> _function;
176
+ } SWIFT_NONCOPYABLE;
177
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
178
+ inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
179
+ return Func_void_bool_Wrapper(std::move(value));
180
+ }
181
+
182
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
183
+ /**
184
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
185
+ */
186
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
187
+ /**
188
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
189
+ */
190
+ class Func_void_std__exception_ptr_Wrapper final {
191
+ public:
192
+ 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))) {}
193
+ inline void call(std::exception_ptr error) const noexcept {
194
+ _function->operator()(error);
195
+ }
196
+ private:
197
+ std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
198
+ } SWIFT_NONCOPYABLE;
199
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
200
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
201
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
202
+ }
203
+
204
+ // pragma MARK: std::optional<double>
205
+ /**
206
+ * Specialized version of `std::optional<double>`.
207
+ */
208
+ using std__optional_double_ = std::optional<double>;
209
+ inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
210
+ return std::optional<double>(value);
211
+ }
212
+ inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
213
+ return optional.has_value();
214
+ }
215
+ inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
216
+ return optional.value();
217
+ }
218
+
219
+ // pragma MARK: std::optional<std::string>
220
+ /**
221
+ * Specialized version of `std::optional<std::string>`.
222
+ */
223
+ using std__optional_std__string_ = std::optional<std::string>;
224
+ inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
225
+ return std::optional<std::string>(value);
226
+ }
227
+ inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
228
+ return optional.has_value();
229
+ }
230
+ inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
231
+ return optional.value();
232
+ }
233
+
234
+ // pragma MARK: std::variant<nitro::NullType, bool>
235
+ /**
236
+ * Wrapper struct for `std::variant<nitro::NullType, bool>`.
237
+ * std::variant cannot be used in Swift because of a Swift bug.
238
+ * Not even specializing it works. So we create a wrapper struct.
239
+ */
240
+ struct std__variant_nitro__NullType__bool_ final {
241
+ std::variant<nitro::NullType, bool> variant;
242
+ std__variant_nitro__NullType__bool_(std::variant<nitro::NullType, bool> variant): variant(variant) { }
243
+ operator std::variant<nitro::NullType, bool>() const noexcept {
244
+ return variant;
245
+ }
246
+ inline size_t index() const noexcept {
247
+ return variant.index();
248
+ }
249
+ inline nitro::NullType get_0() const noexcept {
250
+ return std::get<0>(variant);
251
+ }
252
+ inline bool get_1() const noexcept {
253
+ return std::get<1>(variant);
254
+ }
255
+ };
256
+ inline std__variant_nitro__NullType__bool_ create_std__variant_nitro__NullType__bool_(nitro::NullType value) noexcept {
257
+ return std__variant_nitro__NullType__bool_(value);
258
+ }
259
+ inline std__variant_nitro__NullType__bool_ create_std__variant_nitro__NullType__bool_(bool value) noexcept {
260
+ return std__variant_nitro__NullType__bool_(value);
261
+ }
262
+
263
+ // pragma MARK: std::optional<std::variant<nitro::NullType, bool>>
264
+ /**
265
+ * Specialized version of `std::optional<std::variant<nitro::NullType, bool>>`.
266
+ */
267
+ using std__optional_std__variant_nitro__NullType__bool__ = std::optional<std::variant<nitro::NullType, bool>>;
268
+ inline std::optional<std::variant<nitro::NullType, bool>> create_std__optional_std__variant_nitro__NullType__bool__(const std::variant<nitro::NullType, bool>& value) noexcept {
269
+ return std::optional<std::variant<nitro::NullType, bool>>(value);
270
+ }
271
+ inline bool has_value_std__optional_std__variant_nitro__NullType__bool__(const std::optional<std::variant<nitro::NullType, bool>>& optional) noexcept {
272
+ return optional.has_value();
273
+ }
274
+ inline std::variant<nitro::NullType, bool> get_std__optional_std__variant_nitro__NullType__bool__(const std::optional<std::variant<nitro::NullType, bool>>& optional) noexcept {
275
+ return optional.value();
276
+ }
277
+
278
+ // pragma MARK: std::optional<PushErrorInfo>
279
+ /**
280
+ * Specialized version of `std::optional<PushErrorInfo>`.
281
+ */
282
+ using std__optional_PushErrorInfo_ = std::optional<PushErrorInfo>;
283
+ inline std::optional<PushErrorInfo> create_std__optional_PushErrorInfo_(const PushErrorInfo& value) noexcept {
284
+ return std::optional<PushErrorInfo>(value);
285
+ }
286
+ inline bool has_value_std__optional_PushErrorInfo_(const std::optional<PushErrorInfo>& optional) noexcept {
287
+ return optional.has_value();
288
+ }
289
+ inline PushErrorInfo get_std__optional_PushErrorInfo_(const std::optional<PushErrorInfo>& optional) noexcept {
290
+ return optional.value();
291
+ }
292
+
293
+ // pragma MARK: std::shared_ptr<Promise<PushPermissionResult>>
294
+ /**
295
+ * Specialized version of `std::shared_ptr<Promise<PushPermissionResult>>`.
296
+ */
297
+ using std__shared_ptr_Promise_PushPermissionResult__ = std::shared_ptr<Promise<PushPermissionResult>>;
298
+ inline std::shared_ptr<Promise<PushPermissionResult>> create_std__shared_ptr_Promise_PushPermissionResult__() noexcept {
299
+ return Promise<PushPermissionResult>::create();
300
+ }
301
+ inline PromiseHolder<PushPermissionResult> wrap_std__shared_ptr_Promise_PushPermissionResult__(std::shared_ptr<Promise<PushPermissionResult>> promise) noexcept {
302
+ return PromiseHolder<PushPermissionResult>(std::move(promise));
303
+ }
304
+
305
+ // pragma MARK: std::function<void(const PushPermissionResult& /* result */)>
306
+ /**
307
+ * Specialized version of `std::function<void(const PushPermissionResult&)>`.
308
+ */
309
+ using Func_void_PushPermissionResult = std::function<void(const PushPermissionResult& /* result */)>;
310
+ /**
311
+ * Wrapper class for a `std::function<void(const PushPermissionResult& / * result * /)>`, this can be used from Swift.
312
+ */
313
+ class Func_void_PushPermissionResult_Wrapper final {
314
+ public:
315
+ explicit Func_void_PushPermissionResult_Wrapper(std::function<void(const PushPermissionResult& /* result */)>&& func): _function(std::make_unique<std::function<void(const PushPermissionResult& /* result */)>>(std::move(func))) {}
316
+ inline void call(PushPermissionResult result) const noexcept {
317
+ _function->operator()(result);
318
+ }
319
+ private:
320
+ std::unique_ptr<std::function<void(const PushPermissionResult& /* result */)>> _function;
321
+ } SWIFT_NONCOPYABLE;
322
+ Func_void_PushPermissionResult create_Func_void_PushPermissionResult(void* NON_NULL swiftClosureWrapper) noexcept;
323
+ inline Func_void_PushPermissionResult_Wrapper wrap_Func_void_PushPermissionResult(Func_void_PushPermissionResult value) noexcept {
324
+ return Func_void_PushPermissionResult_Wrapper(std::move(value));
325
+ }
326
+
327
+ // pragma MARK: std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>
328
+ /**
329
+ * Specialized version of `std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>`.
330
+ */
331
+ using std__shared_ptr_Promise_std__variant_nitro__NullType__bool___ = std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>;
332
+ inline std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>> create_std__shared_ptr_Promise_std__variant_nitro__NullType__bool___() noexcept {
333
+ return Promise<std::variant<nitro::NullType, bool>>::create();
334
+ }
335
+ inline PromiseHolder<std::variant<nitro::NullType, bool>> wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__bool___(std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>> promise) noexcept {
336
+ return PromiseHolder<std::variant<nitro::NullType, bool>>(std::move(promise));
337
+ }
338
+
339
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, bool>& /* result */)>
340
+ /**
341
+ * Specialized version of `std::function<void(const std::variant<nitro::NullType, bool>&)>`.
342
+ */
343
+ using Func_void_std__variant_nitro__NullType__bool_ = std::function<void(const std::variant<nitro::NullType, bool>& /* result */)>;
344
+ /**
345
+ * Wrapper class for a `std::function<void(const std::variant<nitro::NullType, bool>& / * result * /)>`, this can be used from Swift.
346
+ */
347
+ class Func_void_std__variant_nitro__NullType__bool__Wrapper final {
348
+ public:
349
+ explicit Func_void_std__variant_nitro__NullType__bool__Wrapper(std::function<void(const std::variant<nitro::NullType, bool>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::variant<nitro::NullType, bool>& /* result */)>>(std::move(func))) {}
350
+ inline void call(std::variant<nitro::NullType, bool> result) const noexcept {
351
+ _function->operator()(result);
352
+ }
353
+ private:
354
+ std::unique_ptr<std::function<void(const std::variant<nitro::NullType, bool>& /* result */)>> _function;
355
+ } SWIFT_NONCOPYABLE;
356
+ Func_void_std__variant_nitro__NullType__bool_ create_Func_void_std__variant_nitro__NullType__bool_(void* NON_NULL swiftClosureWrapper) noexcept;
357
+ inline Func_void_std__variant_nitro__NullType__bool__Wrapper wrap_Func_void_std__variant_nitro__NullType__bool_(Func_void_std__variant_nitro__NullType__bool_ value) noexcept {
358
+ return Func_void_std__variant_nitro__NullType__bool__Wrapper(std::move(value));
359
+ }
360
+
139
361
  // pragma MARK: std::shared_ptr<HybridAcousticConnectRNSpec>
140
362
  /**
141
363
  * Specialized version of `std::shared_ptr<HybridAcousticConnectRNSpec>`.
@@ -174,5 +396,32 @@ namespace margelo::nitro::acousticconnectrn::bridge::swift {
174
396
  inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
175
397
  return Result<double>::withError(error);
176
398
  }
399
+
400
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
401
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
402
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
403
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
404
+ }
405
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
406
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
407
+ }
408
+
409
+ // pragma MARK: Result<std::shared_ptr<Promise<PushPermissionResult>>>
410
+ using Result_std__shared_ptr_Promise_PushPermissionResult___ = Result<std::shared_ptr<Promise<PushPermissionResult>>>;
411
+ inline Result_std__shared_ptr_Promise_PushPermissionResult___ create_Result_std__shared_ptr_Promise_PushPermissionResult___(const std::shared_ptr<Promise<PushPermissionResult>>& value) noexcept {
412
+ return Result<std::shared_ptr<Promise<PushPermissionResult>>>::withValue(value);
413
+ }
414
+ inline Result_std__shared_ptr_Promise_PushPermissionResult___ create_Result_std__shared_ptr_Promise_PushPermissionResult___(const std::exception_ptr& error) noexcept {
415
+ return Result<std::shared_ptr<Promise<PushPermissionResult>>>::withError(error);
416
+ }
417
+
418
+ // pragma MARK: Result<std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>>
419
+ using Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____ = Result<std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>>;
420
+ inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____(const std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>& value) noexcept {
421
+ return Result<std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>>::withValue(value);
422
+ }
423
+ inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____(const std::exception_ptr& error) noexcept {
424
+ return Result<std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>>>::withError(error);
425
+ }
177
426
 
178
427
  } // namespace margelo::nitro::acousticconnectrn::bridge::swift
@@ -10,10 +10,18 @@
10
10
  // Forward declarations of C++ defined types
11
11
  // Forward declaration of `HybridAcousticConnectRNSpec` to properly resolve imports.
12
12
  namespace margelo::nitro::acousticconnectrn { class HybridAcousticConnectRNSpec; }
13
+ // Forward declaration of `PushErrorInfo` to properly resolve imports.
14
+ namespace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
15
+ // Forward declaration of `PushPermissionResult` to properly resolve imports.
16
+ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
13
17
 
14
18
  // Include C++ defined types
15
19
  #include "HybridAcousticConnectRNSpec.hpp"
20
+ #include "PushErrorInfo.hpp"
21
+ #include "PushPermissionResult.hpp"
22
+ #include <NitroModules/ArrayBuffer.hpp>
16
23
  #include <NitroModules/Null.hpp>
24
+ #include <NitroModules/Promise.hpp>
17
25
  #include <NitroModules/Result.hpp>
18
26
  #include <exception>
19
27
  #include <memory>
@@ -12,13 +12,23 @@
12
12
  // Forward declaration of `HybridAcousticConnectRNSpec_cxx` to properly resolve imports.
13
13
  namespace AcousticConnectRN { class HybridAcousticConnectRNSpec_cxx; }
14
14
 
15
-
15
+ // Forward declaration of `ArrayBufferHolder` to properly resolve imports.
16
+ namespace NitroModules { class ArrayBufferHolder; }
17
+ // Forward declaration of `PushErrorInfo` to properly resolve imports.
18
+ namespace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
19
+ // Forward declaration of `PushPermissionResult` to properly resolve imports.
20
+ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
16
21
 
17
22
  #include <string>
18
23
  #include <variant>
19
24
  #include <NitroModules/Null.hpp>
20
25
  #include <optional>
21
26
  #include <unordered_map>
27
+ #include <NitroModules/Promise.hpp>
28
+ #include <NitroModules/ArrayBuffer.hpp>
29
+ #include <NitroModules/ArrayBufferHolder.hpp>
30
+ #include "PushErrorInfo.hpp"
31
+ #include "PushPermissionResult.hpp"
22
32
 
23
33
  #include "AcousticConnectRN-Swift-Cxx-Umbrella.hpp"
24
34
 
@@ -262,6 +272,62 @@ namespace margelo::nitro::acousticconnectrn {
262
272
  auto __value = std::move(__result.value());
263
273
  return __value;
264
274
  }
275
+ inline std::shared_ptr<Promise<bool>> pushDidRegisterWithToken(const std::shared_ptr<ArrayBuffer>& deviceToken) override {
276
+ auto __result = _swiftPart.pushDidRegisterWithToken(ArrayBufferHolder(deviceToken));
277
+ if (__result.hasError()) [[unlikely]] {
278
+ std::rethrow_exception(__result.error());
279
+ }
280
+ auto __value = std::move(__result.value());
281
+ return __value;
282
+ }
283
+ inline std::shared_ptr<Promise<bool>> pushDidFailToRegister(const PushErrorInfo& error) override {
284
+ auto __result = _swiftPart.pushDidFailToRegister(std::forward<decltype(error)>(error));
285
+ if (__result.hasError()) [[unlikely]] {
286
+ std::rethrow_exception(__result.error());
287
+ }
288
+ auto __value = std::move(__result.value());
289
+ return __value;
290
+ }
291
+ inline std::shared_ptr<Promise<bool>> pushDidReceiveNotification(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) override {
292
+ auto __result = _swiftPart.pushDidReceiveNotification(userInfo);
293
+ if (__result.hasError()) [[unlikely]] {
294
+ std::rethrow_exception(__result.error());
295
+ }
296
+ auto __value = std::move(__result.value());
297
+ return __value;
298
+ }
299
+ inline std::shared_ptr<Promise<bool>> pushDidReceiveResponse(const std::string& actionIdentifier, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) override {
300
+ auto __result = _swiftPart.pushDidReceiveResponse(actionIdentifier, userInfo);
301
+ if (__result.hasError()) [[unlikely]] {
302
+ std::rethrow_exception(__result.error());
303
+ }
304
+ auto __value = std::move(__result.value());
305
+ return __value;
306
+ }
307
+ inline std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<nitro::NullType, bool>>& granted, const std::optional<PushErrorInfo>& error) override {
308
+ auto __result = _swiftPart.pushDidReceiveAuthorization(granted, error);
309
+ if (__result.hasError()) [[unlikely]] {
310
+ std::rethrow_exception(__result.error());
311
+ }
312
+ auto __value = std::move(__result.value());
313
+ return __value;
314
+ }
315
+ inline std::shared_ptr<Promise<PushPermissionResult>> pushRequestPermission() override {
316
+ auto __result = _swiftPart.pushRequestPermission();
317
+ if (__result.hasError()) [[unlikely]] {
318
+ std::rethrow_exception(__result.error());
319
+ }
320
+ auto __value = std::move(__result.value());
321
+ return __value;
322
+ }
323
+ inline std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>> pushGetPermissionState() override {
324
+ auto __result = _swiftPart.pushGetPermissionState();
325
+ if (__result.hasError()) [[unlikely]] {
326
+ std::rethrow_exception(__result.error());
327
+ }
328
+ auto __value = std::move(__result.value());
329
+ return __value;
330
+ }
265
331
 
266
332
  private:
267
333
  AcousticConnectRN::HybridAcousticConnectRNSpec_cxx _swiftPart;
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_PushPermissionResult.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 `(_ value: PushPermissionResult) -> 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_PushPermissionResult {
15
+ public typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
16
+
17
+ private let closure: (_ value: PushPermissionResult) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: PushPermissionResult) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: PushPermissionResult) -> Void {
25
+ self.closure(value)
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_PushPermissionResult`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_PushPermissionResult>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_PushPermissionResult {
44
+ return Unmanaged<Func_void_PushPermissionResult>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_bool.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 `(_ value: Bool) -> 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_bool {
15
+ public typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
16
+
17
+ private let closure: (_ value: Bool) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: Bool) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: Bool) -> Void {
25
+ self.closure(value)
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_bool`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
44
+ return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_std__exception_ptr.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 `(_ error: Error) -> 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_std__exception_ptr {
15
+ public typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
16
+
17
+ private let closure: (_ error: Error) -> Void
18
+
19
+ public init(_ closure: @escaping (_ error: Error) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(error: std.exception_ptr) -> Void {
25
+ self.closure(RuntimeError.from(cppError: error))
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_std__exception_ptr`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
44
+ return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,58 @@
1
+ ///
2
+ /// Func_void_std__variant_nitro__NullType__bool_.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 `(_ value: Variant_NullType_Bool) -> 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_std__variant_nitro__NullType__bool_ {
15
+ public typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
16
+
17
+ private let closure: (_ value: Variant_NullType_Bool) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: Variant_NullType_Bool) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: bridge.std__variant_nitro__NullType__bool_) -> Void {
25
+ self.closure({ () -> Variant_NullType_Bool in
26
+ let __variant = value
27
+ switch __variant.index() {
28
+ case 0:
29
+ let __actual = __variant.get_0()
30
+ return .first(NullType.null)
31
+ case 1:
32
+ let __actual = __variant.get_1()
33
+ return .second(__actual)
34
+ default:
35
+ fatalError("Variant can never have index \(__variant.index())!")
36
+ }
37
+ }())
38
+ }
39
+
40
+ /**
41
+ * Casts this instance to a retained unsafe raw pointer.
42
+ * This acquires one additional strong reference on the object!
43
+ */
44
+ @inline(__always)
45
+ public func toUnsafe() -> UnsafeMutableRawPointer {
46
+ return Unmanaged.passRetained(self).toOpaque()
47
+ }
48
+
49
+ /**
50
+ * Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__bool_`.
51
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__variant_nitro__NullType__bool_>`.
52
+ * This removes one strong reference from the object!
53
+ */
54
+ @inline(__always)
55
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__bool_ {
56
+ return Unmanaged<Func_void_std__variant_nitro__NullType__bool_>.fromOpaque(pointer).takeRetainedValue()
57
+ }
58
+ }
@@ -37,6 +37,13 @@ public protocol HybridAcousticConnectRNSpec_protocol: HybridObject {
37
37
  func logDialogDismissEvent(dialogId: String, dismissReason: String) throws -> Bool
38
38
  func logDialogButtonClickEvent(dialogId: String, buttonText: String, buttonIndex: Double) throws -> Bool
39
39
  func logDialogCustomEvent(dialogId: String, eventName: String, values: Dictionary<String, Variant_Bool_String_Double>) throws -> Bool
40
+ func pushDidRegisterWithToken(deviceToken: ArrayBuffer) throws -> Promise<Bool>
41
+ func pushDidFailToRegister(error: PushErrorInfo) throws -> Promise<Bool>
42
+ func pushDidReceiveNotification(userInfo: Dictionary<String, Variant_Bool_String_Double>) throws -> Promise<Bool>
43
+ func pushDidReceiveResponse(actionIdentifier: String, userInfo: Dictionary<String, Variant_Bool_String_Double>) throws -> Promise<Bool>
44
+ func pushDidReceiveAuthorization(granted: Variant_NullType_Bool?, error: PushErrorInfo?) throws -> Promise<Bool>
45
+ func pushRequestPermission() throws -> Promise<PushPermissionResult>
46
+ func pushGetPermissionState() throws -> Promise<Variant_NullType_Bool>
40
47
  }
41
48
 
42
49
  public extension HybridAcousticConnectRNSpec_protocol {