react-native-push-signal 0.1.6 → 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.
Files changed (97) hide show
  1. package/LICENSE +1 -1
  2. package/PushSignal.podspec +2 -12
  3. package/README.md +1 -3
  4. package/README.ru.md +1 -3
  5. package/android/build.gradle +1 -62
  6. package/android/consumer-rules.pro +3 -3
  7. package/android/src/main/AndroidManifest.xml +2 -2
  8. package/android/src/main/java/com/pushsignal/PushModels.kt +15 -0
  9. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalCenter.kt +2 -3
  10. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalInitProvider.kt +1 -1
  11. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalMessagingService.kt +1 -1
  12. package/android/src/main/java/com/pushsignal/PushSignalModule.kt +88 -0
  13. package/android/src/main/java/com/pushsignal/PushSignalPackage.kt +30 -0
  14. package/ios/PushSignal.h +4 -0
  15. package/ios/PushSignal.mm +57 -0
  16. package/ios/PushSignalCenter.h +26 -0
  17. package/ios/PushSignalCenter.m +608 -0
  18. package/ios/PushSignalLaunchStore.m +3 -14
  19. package/lib/module/NativePushSignal.js +5 -0
  20. package/lib/module/NativePushSignal.js.map +1 -0
  21. package/lib/module/pushSignal.native.js +33 -7
  22. package/lib/module/pushSignal.native.js.map +1 -1
  23. package/lib/module/types.js +2 -0
  24. package/lib/module/types.js.map +1 -0
  25. package/lib/typescript/src/NativePushSignal.d.ts +22 -0
  26. package/lib/typescript/src/NativePushSignal.d.ts.map +1 -0
  27. package/lib/typescript/src/index.d.ts +1 -1
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/pushSignal.d.ts +1 -1
  30. package/lib/typescript/src/pushSignal.d.ts.map +1 -1
  31. package/lib/typescript/src/pushSignal.native.d.ts +1 -1
  32. package/lib/typescript/src/pushSignal.native.d.ts.map +1 -1
  33. package/lib/typescript/src/{PushSignal.nitro.d.ts → types.d.ts} +2 -12
  34. package/lib/typescript/src/types.d.ts.map +1 -0
  35. package/package.json +14 -19
  36. package/src/NativePushSignal.ts +25 -0
  37. package/src/index.tsx +1 -1
  38. package/src/pushSignal.native.tsx +54 -11
  39. package/src/pushSignal.tsx +1 -1
  40. package/src/types.ts +25 -0
  41. package/android/CMakeLists.txt +0 -24
  42. package/android/src/main/cpp/cpp-adapter.cpp +0 -11
  43. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignal.kt +0 -38
  44. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalPackage.kt +0 -22
  45. package/ios/PushSignal.swift +0 -29
  46. package/ios/PushSignalCenter.swift +0 -604
  47. package/lib/module/PushSignal.nitro.js +0 -4
  48. package/lib/module/PushSignal.nitro.js.map +0 -1
  49. package/lib/typescript/src/PushSignal.nitro.d.ts.map +0 -1
  50. package/nitro.json +0 -23
  51. package/nitrogen/generated/android/c++/JAndroidFirebaseConfig.hpp +0 -70
  52. package/nitrogen/generated/android/c++/JFunc_void_PushMessage.hpp +0 -80
  53. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.cpp +0 -114
  54. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.hpp +0 -66
  55. package/nitrogen/generated/android/c++/JPushCredentials.hpp +0 -70
  56. package/nitrogen/generated/android/c++/JPushEnvironment.hpp +0 -58
  57. package/nitrogen/generated/android/c++/JPushMessage.hpp +0 -84
  58. package/nitrogen/generated/android/c++/JPushPlatform.hpp +0 -58
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/AndroidFirebaseConfig.kt +0 -66
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/Func_void_PushMessage.kt +0 -78
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/HybridPushSignalSpec.kt +0 -79
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushCredentials.kt +0 -61
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushEnvironment.kt +0 -23
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushMessage.kt +0 -66
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushPlatform.kt +0 -23
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/pushsignalOnLoad.kt +0 -35
  67. package/nitrogen/generated/android/pushsignal+autolinking.cmake +0 -81
  68. package/nitrogen/generated/android/pushsignal+autolinking.gradle +0 -27
  69. package/nitrogen/generated/android/pushsignalOnLoad.cpp +0 -56
  70. package/nitrogen/generated/android/pushsignalOnLoad.hpp +0 -34
  71. package/nitrogen/generated/ios/PushSignal+autolinking.rb +0 -62
  72. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.cpp +0 -65
  73. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.hpp +0 -254
  74. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Umbrella.hpp +0 -63
  75. package/nitrogen/generated/ios/PushSignalAutolinking.mm +0 -33
  76. package/nitrogen/generated/ios/PushSignalAutolinking.swift +0 -26
  77. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.cpp +0 -11
  78. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.hpp +0 -120
  79. package/nitrogen/generated/ios/swift/AndroidFirebaseConfig.swift +0 -96
  80. package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
  81. package/nitrogen/generated/ios/swift/Func_void_PushCredentials.swift +0 -46
  82. package/nitrogen/generated/ios/swift/Func_void_PushMessage.swift +0 -46
  83. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
  84. package/nitrogen/generated/ios/swift/HybridPushSignalSpec.swift +0 -58
  85. package/nitrogen/generated/ios/swift/HybridPushSignalSpec_cxx.swift +0 -196
  86. package/nitrogen/generated/ios/swift/PushCredentials.swift +0 -45
  87. package/nitrogen/generated/ios/swift/PushEnvironment.swift +0 -40
  88. package/nitrogen/generated/ios/swift/PushMessage.swift +0 -97
  89. package/nitrogen/generated/ios/swift/PushPlatform.swift +0 -40
  90. package/nitrogen/generated/shared/c++/AndroidFirebaseConfig.hpp +0 -96
  91. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.cpp +0 -24
  92. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.hpp +0 -74
  93. package/nitrogen/generated/shared/c++/PushCredentials.hpp +0 -97
  94. package/nitrogen/generated/shared/c++/PushEnvironment.hpp +0 -76
  95. package/nitrogen/generated/shared/c++/PushMessage.hpp +0 -97
  96. package/nitrogen/generated/shared/c++/PushPlatform.hpp +0 -76
  97. package/src/PushSignal.nitro.ts +0 -39
@@ -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_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,58 +0,0 @@
1
- ///
2
- /// HybridPushSignalSpec.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
- /// See ``HybridPushSignalSpec``
11
- public protocol HybridPushSignalSpec_protocol: HybridObject {
12
- // Properties
13
-
14
-
15
- // Methods
16
- func initialize(config: AndroidFirebaseConfig) throws -> Promise<Void>
17
- func getCredentials() throws -> Promise<PushCredentials>
18
- func setOnMessage(callback: @escaping (_ message: PushMessage) -> Void) throws -> Void
19
- func setOnNotificationPress(callback: @escaping (_ message: PushMessage) -> Void) throws -> Void
20
- }
21
-
22
- public extension HybridPushSignalSpec_protocol {
23
- /// Default implementation of ``HybridObject.toString``
24
- func toString() -> String {
25
- return "[HybridObject PushSignal]"
26
- }
27
- }
28
-
29
- /// See ``HybridPushSignalSpec``
30
- open class HybridPushSignalSpec_base {
31
- private weak var cxxWrapper: HybridPushSignalSpec_cxx? = nil
32
- public init() { }
33
- public func getCxxWrapper() -> HybridPushSignalSpec_cxx {
34
- #if DEBUG
35
- guard self is any HybridPushSignalSpec else {
36
- fatalError("`self` is not a `HybridPushSignalSpec`! Did you accidentally inherit from `HybridPushSignalSpec_base` instead of `HybridPushSignalSpec`?")
37
- }
38
- #endif
39
- if let cxxWrapper = self.cxxWrapper {
40
- return cxxWrapper
41
- } else {
42
- let cxxWrapper = HybridPushSignalSpec_cxx(self as! any HybridPushSignalSpec)
43
- self.cxxWrapper = cxxWrapper
44
- return cxxWrapper
45
- }
46
- }
47
- }
48
-
49
- /**
50
- * A Swift base-protocol representing the PushSignal HybridObject.
51
- * Implement this protocol to create Swift-based instances of PushSignal.
52
- * ```swift
53
- * class HybridPushSignal : HybridPushSignalSpec {
54
- * // ...
55
- * }
56
- * ```
57
- */
58
- public typealias HybridPushSignalSpec = HybridPushSignalSpec_protocol & HybridPushSignalSpec_base
@@ -1,196 +0,0 @@
1
- ///
2
- /// HybridPushSignalSpec_cxx.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
- * A class implementation that bridges HybridPushSignalSpec over to C++.
12
- * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
13
- *
14
- * Also, some Swift types need to be bridged with special handling:
15
- * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
16
- * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
17
- * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
18
- */
19
- open class HybridPushSignalSpec_cxx {
20
- /**
21
- * The Swift <> C++ bridge's namespace (`margelo::nitro::pushsignal::bridge::swift`)
22
- * from `PushSignal-Swift-Cxx-Bridge.hpp`.
23
- * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
24
- */
25
- public typealias bridge = margelo.nitro.pushsignal.bridge.swift
26
-
27
- /**
28
- * Holds an instance of the `HybridPushSignalSpec` Swift protocol.
29
- */
30
- private var __implementation: any HybridPushSignalSpec
31
-
32
- /**
33
- * Holds a weak pointer to the C++ class that wraps the Swift class.
34
- */
35
- private var __cxxPart: bridge.std__weak_ptr_HybridPushSignalSpec_
36
-
37
- /**
38
- * Create a new `HybridPushSignalSpec_cxx` that wraps the given `HybridPushSignalSpec`.
39
- * All properties and methods bridge to C++ types.
40
- */
41
- public init(_ implementation: any HybridPushSignalSpec) {
42
- self.__implementation = implementation
43
- self.__cxxPart = .init()
44
- /* no base class */
45
- }
46
-
47
- /**
48
- * Get the actual `HybridPushSignalSpec` instance this class wraps.
49
- */
50
- @inline(__always)
51
- public func getHybridPushSignalSpec() -> any HybridPushSignalSpec {
52
- return __implementation
53
- }
54
-
55
- /**
56
- * Casts this instance to a retained unsafe raw pointer.
57
- * This acquires one additional strong reference on the object!
58
- */
59
- public func toUnsafe() -> UnsafeMutableRawPointer {
60
- return Unmanaged.passRetained(self).toOpaque()
61
- }
62
-
63
- /**
64
- * Casts an unsafe pointer to a `HybridPushSignalSpec_cxx`.
65
- * The pointer has to be a retained opaque `Unmanaged<HybridPushSignalSpec_cxx>`.
66
- * This removes one strong reference from the object!
67
- */
68
- public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridPushSignalSpec_cxx {
69
- return Unmanaged<HybridPushSignalSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
70
- }
71
-
72
- /**
73
- * Gets (or creates) the C++ part of this Hybrid Object.
74
- * The C++ part is a `std::shared_ptr<HybridPushSignalSpec>`.
75
- */
76
- public func getCxxPart() -> bridge.std__shared_ptr_HybridPushSignalSpec_ {
77
- let cachedCxxPart = self.__cxxPart.lock()
78
- if Bool(fromCxx: cachedCxxPart) {
79
- return cachedCxxPart
80
- } else {
81
- let newCxxPart = bridge.create_std__shared_ptr_HybridPushSignalSpec_(self.toUnsafe())
82
- __cxxPart = bridge.weakify_std__shared_ptr_HybridPushSignalSpec_(newCxxPart)
83
- return newCxxPart
84
- }
85
- }
86
-
87
-
88
-
89
- /**
90
- * Get the memory size of the Swift class (plus size of any other allocations)
91
- * so the JS VM can properly track it and garbage-collect the JS object if needed.
92
- */
93
- @inline(__always)
94
- public var memorySize: Int {
95
- return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
96
- }
97
-
98
- /**
99
- * Compares this object with the given [other] object for reference equality.
100
- */
101
- @inline(__always)
102
- public func equals(other: HybridPushSignalSpec_cxx) -> Bool {
103
- return self.__implementation === other.__implementation
104
- }
105
-
106
- /**
107
- * Call dispose() on the Swift class.
108
- * This _may_ be called manually from JS.
109
- */
110
- @inline(__always)
111
- public func dispose() {
112
- self.__implementation.dispose()
113
- }
114
-
115
- /**
116
- * Call toString() on the Swift class.
117
- */
118
- @inline(__always)
119
- public func toString() -> String {
120
- return self.__implementation.toString()
121
- }
122
-
123
- // Properties
124
-
125
-
126
- // Methods
127
- @inline(__always)
128
- public final func initialize(config: AndroidFirebaseConfig) -> bridge.Result_std__shared_ptr_Promise_void___ {
129
- do {
130
- let __result = try self.__implementation.initialize(config: config)
131
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
132
- let __promise = bridge.create_std__shared_ptr_Promise_void__()
133
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
134
- __result
135
- .then({ __result in __promiseHolder.resolve() })
136
- .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
137
- return __promise
138
- }()
139
- return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
140
- } catch (let __error) {
141
- let __exceptionPtr = __error.toCpp()
142
- return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
143
- }
144
- }
145
-
146
- @inline(__always)
147
- public final func getCredentials() -> bridge.Result_std__shared_ptr_Promise_PushCredentials___ {
148
- do {
149
- let __result = try self.__implementation.getCredentials()
150
- let __resultCpp = { () -> bridge.std__shared_ptr_Promise_PushCredentials__ in
151
- let __promise = bridge.create_std__shared_ptr_Promise_PushCredentials__()
152
- let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_PushCredentials__(__promise)
153
- __result
154
- .then({ __result in __promiseHolder.resolve(__result) })
155
- .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
156
- return __promise
157
- }()
158
- return bridge.create_Result_std__shared_ptr_Promise_PushCredentials___(__resultCpp)
159
- } catch (let __error) {
160
- let __exceptionPtr = __error.toCpp()
161
- return bridge.create_Result_std__shared_ptr_Promise_PushCredentials___(__exceptionPtr)
162
- }
163
- }
164
-
165
- @inline(__always)
166
- public final func setOnMessage(callback: bridge.Func_void_PushMessage) -> bridge.Result_void_ {
167
- do {
168
- try self.__implementation.setOnMessage(callback: { () -> (PushMessage) -> Void in
169
- let __wrappedFunction = bridge.wrap_Func_void_PushMessage(callback)
170
- return { (__message: PushMessage) -> Void in
171
- __wrappedFunction.call(__message)
172
- }
173
- }())
174
- return bridge.create_Result_void_()
175
- } catch (let __error) {
176
- let __exceptionPtr = __error.toCpp()
177
- return bridge.create_Result_void_(__exceptionPtr)
178
- }
179
- }
180
-
181
- @inline(__always)
182
- public final func setOnNotificationPress(callback: bridge.Func_void_PushMessage) -> bridge.Result_void_ {
183
- do {
184
- try self.__implementation.setOnNotificationPress(callback: { () -> (PushMessage) -> Void in
185
- let __wrappedFunction = bridge.wrap_Func_void_PushMessage(callback)
186
- return { (__message: PushMessage) -> Void in
187
- __wrappedFunction.call(__message)
188
- }
189
- }())
190
- return bridge.create_Result_void_()
191
- } catch (let __error) {
192
- let __exceptionPtr = __error.toCpp()
193
- return bridge.create_Result_void_(__exceptionPtr)
194
- }
195
- }
196
- }
@@ -1,45 +0,0 @@
1
- ///
2
- /// 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
- * Represents an instance of `PushCredentials`, backed by a C++ struct.
12
- */
13
- public typealias PushCredentials = margelo.nitro.pushsignal.PushCredentials
14
-
15
- public extension PushCredentials {
16
- private typealias bridge = margelo.nitro.pushsignal.bridge.swift
17
-
18
- /**
19
- * Create a new instance of `PushCredentials`.
20
- */
21
- init(platform: PushPlatform, token: String, environment: PushEnvironment?) {
22
- self.init(platform, std.string(token), { () -> bridge.std__optional_PushEnvironment_ in
23
- if let __unwrappedValue = environment {
24
- return bridge.create_std__optional_PushEnvironment_(__unwrappedValue)
25
- } else {
26
- return .init()
27
- }
28
- }())
29
- }
30
-
31
- @inline(__always)
32
- var platform: PushPlatform {
33
- return self.__platform
34
- }
35
-
36
- @inline(__always)
37
- var token: String {
38
- return String(self.__token)
39
- }
40
-
41
- @inline(__always)
42
- var environment: PushEnvironment? {
43
- return self.__environment.value
44
- }
45
- }
@@ -1,40 +0,0 @@
1
- ///
2
- /// PushEnvironment.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
- /**
9
- * Represents the JS union `PushEnvironment`, backed by a C++ enum.
10
- */
11
- public typealias PushEnvironment = margelo.nitro.pushsignal.PushEnvironment
12
-
13
- public extension PushEnvironment {
14
- /**
15
- * Get a PushEnvironment for the given String value, or
16
- * return `nil` if the given value was invalid/unknown.
17
- */
18
- init?(fromString string: String) {
19
- switch string {
20
- case "sandbox":
21
- self = .sandbox
22
- case "production":
23
- self = .production
24
- default:
25
- return nil
26
- }
27
- }
28
-
29
- /**
30
- * Get the String value this PushEnvironment represents.
31
- */
32
- var stringValue: String {
33
- switch self {
34
- case .sandbox:
35
- return "sandbox"
36
- case .production:
37
- return "production"
38
- }
39
- }
40
- }
@@ -1,97 +0,0 @@
1
- ///
2
- /// 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
- * Represents an instance of `PushMessage`, backed by a C++ struct.
12
- */
13
- public typealias PushMessage = margelo.nitro.pushsignal.PushMessage
14
-
15
- public extension PushMessage {
16
- private typealias bridge = margelo.nitro.pushsignal.bridge.swift
17
-
18
- /**
19
- * Create a new instance of `PushMessage`.
20
- */
21
- init(id: String?, title: String?, body: String?, data: Dictionary<String, String>) {
22
- self.init({ () -> bridge.std__optional_std__string_ in
23
- if let __unwrappedValue = 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 = title {
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 = body {
36
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
37
- } else {
38
- return .init()
39
- }
40
- }(), { () -> bridge.std__unordered_map_std__string__std__string_ in
41
- var __map = bridge.create_std__unordered_map_std__string__std__string_(data.count)
42
- for (__k, __v) in data {
43
- bridge.emplace_std__unordered_map_std__string__std__string_(&__map, std.string(__k), std.string(__v))
44
- }
45
- return __map
46
- }())
47
- }
48
-
49
- @inline(__always)
50
- var id: String? {
51
- return { () -> String? in
52
- if bridge.has_value_std__optional_std__string_(self.__id) {
53
- let __unwrapped = bridge.get_std__optional_std__string_(self.__id)
54
- return String(__unwrapped)
55
- } else {
56
- return nil
57
- }
58
- }()
59
- }
60
-
61
- @inline(__always)
62
- var title: String? {
63
- return { () -> String? in
64
- if bridge.has_value_std__optional_std__string_(self.__title) {
65
- let __unwrapped = bridge.get_std__optional_std__string_(self.__title)
66
- return String(__unwrapped)
67
- } else {
68
- return nil
69
- }
70
- }()
71
- }
72
-
73
- @inline(__always)
74
- var body: String? {
75
- return { () -> String? in
76
- if bridge.has_value_std__optional_std__string_(self.__body) {
77
- let __unwrapped = bridge.get_std__optional_std__string_(self.__body)
78
- return String(__unwrapped)
79
- } else {
80
- return nil
81
- }
82
- }()
83
- }
84
-
85
- @inline(__always)
86
- var data: Dictionary<String, String> {
87
- return { () -> Dictionary<String, String> in
88
- var __dictionary = Dictionary<String, String>(minimumCapacity: self.__data.size())
89
- let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(self.__data)
90
- for __key in __keys {
91
- let __value = bridge.get_std__unordered_map_std__string__std__string__value(self.__data, __key)
92
- __dictionary[String(__key)] = String(__value)
93
- }
94
- return __dictionary
95
- }()
96
- }
97
- }
@@ -1,40 +0,0 @@
1
- ///
2
- /// PushPlatform.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
- /**
9
- * Represents the JS union `PushPlatform`, backed by a C++ enum.
10
- */
11
- public typealias PushPlatform = margelo.nitro.pushsignal.PushPlatform
12
-
13
- public extension PushPlatform {
14
- /**
15
- * Get a PushPlatform for the given String value, or
16
- * return `nil` if the given value was invalid/unknown.
17
- */
18
- init?(fromString string: String) {
19
- switch string {
20
- case "ios":
21
- self = .ios
22
- case "android_os":
23
- self = .androidOs
24
- default:
25
- return nil
26
- }
27
- }
28
-
29
- /**
30
- * Get the String value this PushPlatform represents.
31
- */
32
- var stringValue: String {
33
- switch self {
34
- case .ios:
35
- return "ios"
36
- case .androidOs:
37
- return "android_os"
38
- }
39
- }
40
- }