react-native-push-signal 0.1.4 → 0.1.7
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 +3 -11
- package/README.ru.md +3 -11
- 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 +24 -71
- 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 +608 -0
- package/ios/PushSignalLaunchStore.m +6 -9
- package/lib/module/NativePushSignal.js +5 -0
- package/lib/module/NativePushSignal.js.map +1 -0
- package/lib/module/pushSignal.native.js +36 -12
- 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/types.d.ts +22 -0
- 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 +60 -22
- 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 -588
- 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 +0 -32
- 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_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.hpp +0 -128
- package/nitrogen/generated/android/c++/JFunc_void_PushMessage.hpp +0 -80
- package/nitrogen/generated/android/c++/JHybridPushSignalSpec.cpp +0 -115
- 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_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.kt +0 -78
- 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 -58
- 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 -90
- package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.hpp +0 -345
- 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_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.swift +0 -61
- 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_bool.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_bool__.swift +0 -66
- package/nitrogen/generated/ios/swift/HybridPushSignalSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridPushSignalSpec_cxx.swift +0 -217
- 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,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<std::shared_ptr<Promise<std::shared_ptr<Promise<bool>>>>(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,61 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.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 `(_ message: PushMessage) -> Promise<Promise<Bool>>` 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_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage {
|
|
15
|
-
public typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
16
|
-
|
|
17
|
-
private let closure: (_ message: PushMessage) -> Promise<Promise<Bool>>
|
|
18
|
-
|
|
19
|
-
public init(_ closure: @escaping (_ message: PushMessage) -> Promise<Promise<Bool>>) {
|
|
20
|
-
self.closure = closure
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@inline(__always)
|
|
24
|
-
public func call(message: PushMessage) -> bridge.std__shared_ptr_Promise_std__shared_ptr_Promise_bool____ {
|
|
25
|
-
let __result: Promise<Promise<Bool>> = self.closure(message)
|
|
26
|
-
return { () -> bridge.std__shared_ptr_Promise_std__shared_ptr_Promise_bool____ in
|
|
27
|
-
let __promise = bridge.create_std__shared_ptr_Promise_std__shared_ptr_Promise_bool____()
|
|
28
|
-
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_bool____(__promise)
|
|
29
|
-
__result
|
|
30
|
-
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
31
|
-
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
32
|
-
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
33
|
-
__result
|
|
34
|
-
.then({ __result in __promiseHolder.resolve(__result) })
|
|
35
|
-
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
36
|
-
return __promise
|
|
37
|
-
}()) })
|
|
38
|
-
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
39
|
-
return __promise
|
|
40
|
-
}()
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
45
|
-
* This acquires one additional strong reference on the object!
|
|
46
|
-
*/
|
|
47
|
-
@inline(__always)
|
|
48
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
49
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Casts an unsafe pointer to a `Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage`.
|
|
54
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage>`.
|
|
55
|
-
* This removes one strong reference from the object!
|
|
56
|
-
*/
|
|
57
|
-
@inline(__always)
|
|
58
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage {
|
|
59
|
-
return Unmanaged<Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage>.fromOpaque(pointer).takeRetainedValue()
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_PushCredentials.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: PushCredentials) -> 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_PushCredentials {
|
|
15
|
-
public typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
16
|
-
|
|
17
|
-
private let closure: (_ value: PushCredentials) -> Void
|
|
18
|
-
|
|
19
|
-
public init(_ closure: @escaping (_ value: PushCredentials) -> Void) {
|
|
20
|
-
self.closure = closure
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@inline(__always)
|
|
24
|
-
public func call(value: PushCredentials) -> 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_PushCredentials`.
|
|
39
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_PushCredentials>`.
|
|
40
|
-
* This removes one strong reference from the object!
|
|
41
|
-
*/
|
|
42
|
-
@inline(__always)
|
|
43
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_PushCredentials {
|
|
44
|
-
return Unmanaged<Func_void_PushCredentials>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_PushMessage.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 `(_ message: PushMessage) -> 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_PushMessage {
|
|
15
|
-
public typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
16
|
-
|
|
17
|
-
private let closure: (_ message: PushMessage) -> Void
|
|
18
|
-
|
|
19
|
-
public init(_ closure: @escaping (_ message: PushMessage) -> Void) {
|
|
20
|
-
self.closure = closure
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@inline(__always)
|
|
24
|
-
public func call(message: PushMessage) -> Void {
|
|
25
|
-
self.closure(message)
|
|
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_PushMessage`.
|
|
39
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_PushMessage>`.
|
|
40
|
-
* This removes one strong reference from the object!
|
|
41
|
-
*/
|
|
42
|
-
@inline(__always)
|
|
43
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_PushMessage {
|
|
44
|
-
return Unmanaged<Func_void_PushMessage>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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.pushsignal.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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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.pushsignal.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
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__shared_ptr_Promise_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: Promise<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__shared_ptr_Promise_bool__ {
|
|
15
|
-
public typealias bridge = margelo.nitro.pushsignal.bridge.swift
|
|
16
|
-
|
|
17
|
-
private let closure: (_ value: Promise<Bool>) -> Void
|
|
18
|
-
|
|
19
|
-
public init(_ closure: @escaping (_ value: Promise<Bool>) -> Void) {
|
|
20
|
-
self.closure = closure
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@inline(__always)
|
|
24
|
-
public func call(value: bridge.std__shared_ptr_Promise_bool__) -> Void {
|
|
25
|
-
self.closure({ () -> Promise<Bool> in
|
|
26
|
-
let __promise = Promise<Bool>()
|
|
27
|
-
let __resolver = { (__result: Bool) in
|
|
28
|
-
__promise.resolve(withResult: __result)
|
|
29
|
-
}
|
|
30
|
-
let __rejecter = { (__error: Error) in
|
|
31
|
-
__promise.reject(withError: __error)
|
|
32
|
-
}
|
|
33
|
-
let __resolverCpp = { () -> bridge.Func_void_bool in
|
|
34
|
-
let __closureWrapper = Func_void_bool(__resolver)
|
|
35
|
-
return bridge.create_Func_void_bool(__closureWrapper.toUnsafe())
|
|
36
|
-
}()
|
|
37
|
-
let __rejecterCpp = { () -> bridge.Func_void_std__exception_ptr in
|
|
38
|
-
let __closureWrapper = Func_void_std__exception_ptr(__rejecter)
|
|
39
|
-
return bridge.create_Func_void_std__exception_ptr(__closureWrapper.toUnsafe())
|
|
40
|
-
}()
|
|
41
|
-
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(value)
|
|
42
|
-
__promiseHolder.addOnResolvedListenerCopy(__resolverCpp)
|
|
43
|
-
__promiseHolder.addOnRejectedListener(__rejecterCpp)
|
|
44
|
-
return __promise
|
|
45
|
-
}())
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
50
|
-
* This acquires one additional strong reference on the object!
|
|
51
|
-
*/
|
|
52
|
-
@inline(__always)
|
|
53
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
54
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Casts an unsafe pointer to a `Func_void_std__shared_ptr_Promise_bool__`.
|
|
59
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__shared_ptr_Promise_bool__>`.
|
|
60
|
-
* This removes one strong reference from the object!
|
|
61
|
-
*/
|
|
62
|
-
@inline(__always)
|
|
63
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__shared_ptr_Promise_bool__ {
|
|
64
|
-
return Unmanaged<Func_void_std__shared_ptr_Promise_bool__>.fromOpaque(pointer).takeRetainedValue()
|
|
65
|
-
}
|
|
66
|
-
}
|