bridgefy-react-native 1.1.1 → 1.1.2
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/README.md +49 -12
- package/android/build.gradle +1 -1
- package/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt +59 -18
- package/ios/BridgefyReactNative.m +6 -0
- package/ios/BridgefyReactNative.swift +18 -3
- package/ios/BridgefyReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/BridgefyReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/BridgefyReactNative.xcodeproj/project.xcworkspace/xcuserdata/bridgefy.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BridgefyReactNative.xcodeproj/xcuserdata/bridgefy.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/Frameworks/BridgefySDK.xcframework/Info.plist +4 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/BridgefySDK +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Headers/BridgefySDK-Swift.h +21 -4
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Info.plist +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios.abi.json +1243 -975
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios.private.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/module.modulemap +1 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/_CodeSignature/CodeResources +15 -15
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/dSYMs/BridgefySDK.framework.dSYM/Contents/Info.plist +1 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/DWARF/BridgefySDK +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/Relocations/aarch64/BridgefySDK.yml +11806 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/BridgefySDK +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Headers/BridgefySDK-Swift.h +42 -8
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Info.plist +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1243 -975
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1243 -975
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +8 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/module.modulemap +1 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/_CodeSignature/CodeResources +25 -25
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Info.plist +1 -1
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/DWARF/BridgefySDK +0 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/Relocations/aarch64/BridgefySDK.yml +11410 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/Relocations/x86_64/BridgefySDK.yml +8161 -0
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +8 -0
package/README.md
CHANGED
|
@@ -57,25 +57,34 @@ import { Bridgefy, BridgefyPropagationProfile } from 'bridgefy-react-native';
|
|
|
57
57
|
const bridgefy = new Bridgefy();
|
|
58
58
|
|
|
59
59
|
export default function App() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
bridgefy
|
|
62
|
+
.initialize(
|
|
63
|
+
'your-api-key-here', // UUID - The license key registered on the Bridgefy developer site.
|
|
64
|
+
false, // The logging priority for SDK operations.
|
|
65
|
+
)
|
|
66
|
+
.catch((error) => {
|
|
67
|
+
console.error(error);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
70
71
|
```
|
|
71
72
|
|
|
72
|
-
Once initialized, you can call `start`
|
|
73
|
+
Once initialized, you can call `start` and `stop` Bridgefy SDK operations as follows:
|
|
73
74
|
|
|
74
75
|
```typescript
|
|
76
|
+
/**
|
|
77
|
+
* Start Bridgefy SDK operations
|
|
78
|
+
*/
|
|
75
79
|
bridgefy.start(
|
|
76
|
-
userId
|
|
80
|
+
userId, // UUID? (optional) - The ID used to identify the user in the Bridgefy network.If null is passed, the SDK will assign an autogenerated ID.
|
|
77
81
|
propagationProfile, // PropagationProfile (optional, default: PropagationProfile.Standard) - A profile that defines a series of properties and rules for the propagation of messages.
|
|
78
82
|
);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Stop Bridgefy SDK operations
|
|
86
|
+
*/
|
|
87
|
+
bridgefy.stop()
|
|
79
88
|
```
|
|
80
89
|
|
|
81
90
|
### Sending data
|
|
@@ -135,6 +144,34 @@ React.useEffect(() => {
|
|
|
135
144
|
|
|
136
145
|
To see a full list of events, see the `BridgefyEvents` enum.
|
|
137
146
|
|
|
147
|
+
## Additional Functionality
|
|
148
|
+
The `Bridgefy` class also provides various functionalities:
|
|
149
|
+
|
|
150
|
+
- `destroySession()`: Destroy current session.
|
|
151
|
+
- `updateLicense()`: Update license.
|
|
152
|
+
- `establishSecureConnection(userId: string): Promise<void>`: Establish a secure connection with a specified user.
|
|
153
|
+
- `currentUserId(): Promise<string>`: Get the current user ID.
|
|
154
|
+
- `connectedPeers(): Promise<string[]>`: Get a list of connected peers.
|
|
155
|
+
- `licenseExpirationDate(): Promise<Date>`: Get the license expiration date.
|
|
156
|
+
- `isInitialized(): Promise<boolean>`: Check if the SDK is initialized.
|
|
157
|
+
- `isStarted(): Promise<boolean>`: Check if the SDK is started.
|
|
158
|
+
|
|
159
|
+
Make sure to handle promises and error scenarios appropriately when using these methods.
|
|
160
|
+
|
|
161
|
+
## Bridgefy Propagation Profiles
|
|
162
|
+
|
|
163
|
+
The `BridgefyPropagationProfile` enum defines the following propagation profiles available for use:
|
|
164
|
+
|
|
165
|
+
- `standard`: Standard propagation profile.
|
|
166
|
+
- `highDensityNetwork`: High-density network profile.
|
|
167
|
+
- `sparseNetwork`: Sparse network profile.
|
|
168
|
+
- `longReach`: Long-reach profile.
|
|
169
|
+
- `shortReach`: Short-reach profile.
|
|
170
|
+
|
|
171
|
+
These profiles can be used when configuring the Bridgefy SDK operations within your React Native application.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
138
175
|
## Multi-Platform Support
|
|
139
176
|
|
|
140
177
|
Bridgefy's SDKs are designed to work seamlessly across different platforms, including iOS and Android. This means that users with different devices can communicate with each other as long as they have the Bridgefy-enabled applications installed.
|
package/android/build.gradle
CHANGED
|
@@ -85,7 +85,7 @@ repositories {
|
|
|
85
85
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
86
86
|
|
|
87
87
|
dependencies {
|
|
88
|
-
implementation (group: "me.bridgefy", name: "android-sdk", version: "1.1.
|
|
88
|
+
implementation (group: "me.bridgefy", name: "android-sdk", version: "1.1.2", ext: "aar") {
|
|
89
89
|
transitive = true
|
|
90
90
|
}
|
|
91
91
|
// For < 0.71, this will be from the local maven repo
|
|
@@ -10,12 +10,12 @@ import com.facebook.react.bridge.ReactMethod
|
|
|
10
10
|
import com.facebook.react.bridge.ReadableMap
|
|
11
11
|
import com.facebook.react.bridge.WritableMap
|
|
12
12
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
13
|
+
import java.util.UUID
|
|
13
14
|
import me.bridgefy.Bridgefy
|
|
14
15
|
import me.bridgefy.commons.TransmissionMode
|
|
15
16
|
import me.bridgefy.commons.exception.BridgefyException
|
|
16
17
|
import me.bridgefy.commons.listener.BridgefyDelegate
|
|
17
18
|
import me.bridgefy.commons.propagation.PropagationProfile
|
|
18
|
-
import java.util.UUID
|
|
19
19
|
|
|
20
20
|
class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
21
21
|
ReactContextBaseJavaModule(reactContext) {
|
|
@@ -34,7 +34,7 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
34
34
|
fun initialize(
|
|
35
35
|
apiKey: String,
|
|
36
36
|
verboseLogging: Boolean = false,
|
|
37
|
-
promise: Promise
|
|
37
|
+
promise: Promise
|
|
38
38
|
) {
|
|
39
39
|
try {
|
|
40
40
|
bridgefy.init(
|
|
@@ -60,7 +60,7 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
60
60
|
sendEvent(
|
|
61
61
|
reactApplicationContext,
|
|
62
62
|
"bridgefyDidEstablishSecureConnection",
|
|
63
|
-
params
|
|
63
|
+
params
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -105,7 +105,7 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
105
105
|
override fun onReceiveData(
|
|
106
106
|
data: ByteArray,
|
|
107
107
|
messageID: UUID,
|
|
108
|
-
transmissionMode: TransmissionMode
|
|
108
|
+
transmissionMode: TransmissionMode
|
|
109
109
|
) {
|
|
110
110
|
val params = Arguments.createMap().apply {
|
|
111
111
|
putString("data", String(data))
|
|
@@ -152,12 +152,14 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
152
152
|
sendEvent(reactApplicationContext, "bridgefyDidStop", null)
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
-
if (verboseLogging) Log.DEBUG else 1
|
|
155
|
+
if (verboseLogging) Log.DEBUG else 1
|
|
156
156
|
)
|
|
157
157
|
promise.resolve(null)
|
|
158
158
|
} catch (error: BridgefyException) {
|
|
159
159
|
val map = mapFromBridgefyException(error)
|
|
160
160
|
promise.reject(map.getString("code"), map.getString("message"), error)
|
|
161
|
+
} catch (e: Exception) {
|
|
162
|
+
promise.reject("sessionError", "${e.message ?: e.localizedMessage}", e)
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
|
|
@@ -165,40 +167,53 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
165
167
|
fun start(
|
|
166
168
|
customUserID: String?,
|
|
167
169
|
propagationProfile: String,
|
|
168
|
-
promise: Promise
|
|
170
|
+
promise: Promise
|
|
169
171
|
) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
try {
|
|
173
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
174
|
+
val profile = propagationProfileFromString(propagationProfile)
|
|
175
|
+
bridgefy.start(
|
|
176
|
+
customUserID?.let { UUID.fromString(it) },
|
|
177
|
+
profile ?: PropagationProfile.Standard
|
|
178
|
+
)
|
|
179
|
+
promise.resolve(null)
|
|
180
|
+
} catch (e: Exception) {
|
|
181
|
+
promise.reject("sessionError", "${e.message ?: e.localizedMessage}", e)
|
|
182
|
+
}
|
|
176
183
|
}
|
|
177
184
|
|
|
178
185
|
@ReactMethod
|
|
179
186
|
fun send(data: String, transmissionMode: ReadableMap, promise: Promise) {
|
|
180
|
-
val mode = transmissionModeFromMap(transmissionMode)!!
|
|
181
187
|
try {
|
|
188
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
189
|
+
assert(bridgefy.isStarted) { "Bridgefy SDK isn't started" }
|
|
190
|
+
val mode = transmissionModeFromMap(transmissionMode)!!
|
|
182
191
|
val uuid = bridgefy.send(data.toByteArray(), mode)
|
|
183
192
|
promise.resolve(
|
|
184
193
|
Arguments.createMap().apply {
|
|
185
194
|
putString("messageId", uuid.toString())
|
|
186
|
-
}
|
|
195
|
+
}
|
|
187
196
|
)
|
|
188
197
|
} catch (error: BridgefyException) {
|
|
189
198
|
val map = mapFromBridgefyException(error)
|
|
190
199
|
promise.reject(map.getString("code"), map.getString("message"), error)
|
|
200
|
+
} catch (e: Exception) {
|
|
201
|
+
promise.reject("sessionError", "${e.message ?: e.localizedMessage}", e)
|
|
191
202
|
}
|
|
192
203
|
}
|
|
193
204
|
|
|
194
205
|
@ReactMethod
|
|
195
206
|
fun stop(promise: Promise) {
|
|
207
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
208
|
+
assert(bridgefy.isStarted) { "Bridgefy SDK isn't started" }
|
|
196
209
|
bridgefy.stop()
|
|
197
210
|
promise.resolve(null)
|
|
198
211
|
}
|
|
199
212
|
|
|
200
213
|
@ReactMethod
|
|
201
214
|
fun connectedPeers(promise: Promise) {
|
|
215
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
216
|
+
assert(bridgefy.isStarted) { "Bridgefy SDK isn't started" }
|
|
202
217
|
val peers = bridgefy.connectedPeers().getOrNull()
|
|
203
218
|
val nodes = Arguments.createArray().apply {
|
|
204
219
|
peers?.forEach { pushString(it.toString()) }
|
|
@@ -214,20 +229,27 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
214
229
|
|
|
215
230
|
@ReactMethod
|
|
216
231
|
fun updateLicense(promise: Promise) {
|
|
232
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
217
233
|
bridgefy.updateLicense()
|
|
218
234
|
promise.resolve(null)
|
|
219
235
|
}
|
|
220
236
|
|
|
221
237
|
@ReactMethod
|
|
222
238
|
fun currentUserID(promise: Promise) {
|
|
239
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
240
|
+
assert(bridgefy.isStarted) { "Bridgefy SDK isn't started" }
|
|
223
241
|
val userId = bridgefy.currentUserId().getOrThrow()
|
|
224
|
-
promise.resolve(
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
promise.resolve(
|
|
243
|
+
Arguments.createMap().apply {
|
|
244
|
+
putString("userId", userId.toString())
|
|
245
|
+
}
|
|
246
|
+
)
|
|
227
247
|
}
|
|
228
248
|
|
|
229
249
|
@ReactMethod
|
|
230
250
|
fun establishSecureConnection(userId: String, promise: Promise) {
|
|
251
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
252
|
+
assert(bridgefy.isStarted) { "Bridgefy SDK isn't started" }
|
|
231
253
|
val uuid = UUID.fromString(userId)
|
|
232
254
|
bridgefy.establishSecureConnection(uuid)
|
|
233
255
|
promise.resolve(null)
|
|
@@ -235,14 +257,33 @@ class BridgefyReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
235
257
|
|
|
236
258
|
@ReactMethod
|
|
237
259
|
fun licenseExpirationDate(promise: Promise) {
|
|
260
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
238
261
|
val date = bridgefy.licenseExpirationDate().getOrThrow()
|
|
239
262
|
promise.resolve(
|
|
240
263
|
Arguments.createMap().apply {
|
|
241
264
|
putString("licenseExpirationDate", date?.time.toString())
|
|
242
|
-
}
|
|
265
|
+
}
|
|
243
266
|
)
|
|
244
267
|
}
|
|
245
268
|
|
|
269
|
+
@ReactMethod
|
|
270
|
+
fun isInitialized(promise: Promise) {
|
|
271
|
+
try {
|
|
272
|
+
val isInitialized = bridgefy.isInitialized
|
|
273
|
+
promise.resolve(isInitialized)
|
|
274
|
+
} catch (e: Exception) {
|
|
275
|
+
e.printStackTrace()
|
|
276
|
+
promise.resolve(false)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@ReactMethod
|
|
281
|
+
fun isStarted(promise: Promise) {
|
|
282
|
+
assert(bridgefy.isInitialized) { "Bridgefy SDK isn't initialized" }
|
|
283
|
+
val isStarted = bridgefy.isStarted
|
|
284
|
+
promise.resolve(isStarted)
|
|
285
|
+
}
|
|
286
|
+
|
|
246
287
|
companion object {
|
|
247
288
|
const val NAME = "BridgefyReactNative"
|
|
248
289
|
}
|
|
@@ -40,6 +40,12 @@ RCT_EXTERN_METHOD(destroySession:(RCTPromiseResolveBlock)resolve
|
|
|
40
40
|
RCT_EXTERN_METHOD(updateLicense:(RCTPromiseResolveBlock)resolve
|
|
41
41
|
reject:(RCTPromiseRejectBlock)reject)
|
|
42
42
|
|
|
43
|
+
RCT_EXTERN_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve
|
|
44
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
45
|
+
|
|
46
|
+
RCT_EXTERN_METHOD(isStarted:(RCTPromiseResolveBlock)resolve
|
|
47
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
48
|
+
|
|
43
49
|
RCT_EXTERN_METHOD(supportedEvents)
|
|
44
50
|
|
|
45
51
|
+ (BOOL)requiresMainQueueSetup
|
|
@@ -13,7 +13,7 @@ class BridgefyReactNative: RCTEventEmitter, BridgefyDelegate {
|
|
|
13
13
|
|
|
14
14
|
@objc(initialize:propagationProfile:resolve:reject:)
|
|
15
15
|
func initialize(apiKey: String,
|
|
16
|
-
verboseLogging:
|
|
16
|
+
verboseLogging: Bool,
|
|
17
17
|
resolve: RCTPromiseResolveBlock,
|
|
18
18
|
reject: RCTPromiseRejectBlock) -> Void {
|
|
19
19
|
do {
|
|
@@ -101,10 +101,19 @@ class BridgefyReactNative: RCTEventEmitter, BridgefyDelegate {
|
|
|
101
101
|
|
|
102
102
|
@objc(updateLicense:reject:)
|
|
103
103
|
func updateLicense(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
104
|
-
//bridgefy!.updateLicense
|
|
105
|
-
|
|
104
|
+
// resolve(bridgefy!.updateLicense)
|
|
105
|
+
resolve(nil)
|
|
106
|
+
}
|
|
107
|
+
@objc(isInitialized:reject:)
|
|
108
|
+
func isInitialized(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
109
|
+
resolve(Bridgefy.isInitialized)
|
|
106
110
|
}
|
|
107
111
|
|
|
112
|
+
@objc(isStarted:reject:)
|
|
113
|
+
func isStarted(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
114
|
+
resolve(Bridgefy.isStarted)
|
|
115
|
+
}
|
|
116
|
+
|
|
108
117
|
// MARK: - RCTEventEmitter
|
|
109
118
|
|
|
110
119
|
open override func supportedEvents() -> [String] {
|
|
@@ -338,6 +347,12 @@ class BridgefyReactNative: RCTEventEmitter, BridgefyDelegate {
|
|
|
338
347
|
type = "encryptionError"
|
|
339
348
|
details = code
|
|
340
349
|
break;
|
|
350
|
+
case .inconsistentUserId:
|
|
351
|
+
type = "inconsistentUserId"
|
|
352
|
+
case .stopInProgress:
|
|
353
|
+
type = "stopInProgress"
|
|
354
|
+
case .destroySessionInProgress:
|
|
355
|
+
type = "destroySessionInProgress"
|
|
341
356
|
@unknown default:
|
|
342
357
|
return [:]
|
|
343
358
|
}
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>BridgefyReactNative.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
<key>AvailableLibraries</key>
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>BridgefySDK.framework/BridgefySDK</string>
|
|
8
10
|
<key>DebugSymbolsPath</key>
|
|
9
11
|
<string>dSYMs</string>
|
|
10
12
|
<key>LibraryIdentifier</key>
|
|
@@ -22,6 +24,8 @@
|
|
|
22
24
|
<string>simulator</string>
|
|
23
25
|
</dict>
|
|
24
26
|
<dict>
|
|
27
|
+
<key>BinaryPath</key>
|
|
28
|
+
<string>BridgefySDK.framework/BridgefySDK</string>
|
|
25
29
|
<key>DebugSymbolsPath</key>
|
|
26
30
|
<string>dSYMs</string>
|
|
27
31
|
<key>LibraryIdentifier</key>
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#if 0
|
|
2
2
|
#elif defined(__arm64__) && __arm64__
|
|
3
|
-
// Generated by Apple Swift version 5.
|
|
3
|
+
// Generated by Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
|
|
4
4
|
#ifndef BRIDGEFYSDK_SWIFT_H
|
|
5
5
|
#define BRIDGEFYSDK_SWIFT_H
|
|
6
6
|
#pragma clang diagnostic push
|
|
@@ -42,12 +42,18 @@
|
|
|
42
42
|
#include <string.h>
|
|
43
43
|
#endif
|
|
44
44
|
#if defined(__cplusplus)
|
|
45
|
-
#if __has_include(<ptrauth.h>)
|
|
45
|
+
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
|
|
46
46
|
# include <ptrauth.h>
|
|
47
47
|
#else
|
|
48
|
+
#pragma clang diagnostic push
|
|
49
|
+
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
|
|
48
50
|
# ifndef __ptrauth_swift_value_witness_function_pointer
|
|
49
51
|
# define __ptrauth_swift_value_witness_function_pointer(x)
|
|
50
52
|
# endif
|
|
53
|
+
# ifndef __ptrauth_swift_class_method_pointer
|
|
54
|
+
# define __ptrauth_swift_class_method_pointer(x)
|
|
55
|
+
# endif
|
|
56
|
+
#pragma clang diagnostic pop
|
|
51
57
|
#endif
|
|
52
58
|
#endif
|
|
53
59
|
|
|
@@ -246,6 +252,17 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
246
252
|
#else
|
|
247
253
|
# define SWIFT_NOEXCEPT
|
|
248
254
|
#endif
|
|
255
|
+
#if !defined(SWIFT_C_INLINE_THUNK)
|
|
256
|
+
# if __has_attribute(always_inline)
|
|
257
|
+
# if __has_attribute(nodebug)
|
|
258
|
+
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
|
|
259
|
+
# else
|
|
260
|
+
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
|
|
261
|
+
# endif
|
|
262
|
+
# else
|
|
263
|
+
# define SWIFT_C_INLINE_THUNK inline
|
|
264
|
+
# endif
|
|
265
|
+
#endif
|
|
249
266
|
#if defined(_WIN32)
|
|
250
267
|
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
|
|
251
268
|
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
|
|
@@ -282,12 +299,12 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
282
299
|
#if defined(__OBJC__)
|
|
283
300
|
|
|
284
301
|
|
|
285
|
-
#endif
|
|
286
|
-
#if defined(__cplusplus)
|
|
287
302
|
#endif
|
|
288
303
|
#if __has_attribute(external_source_symbol)
|
|
289
304
|
# pragma clang attribute pop
|
|
290
305
|
#endif
|
|
306
|
+
#if defined(__cplusplus)
|
|
307
|
+
#endif
|
|
291
308
|
#pragma clang diagnostic pop
|
|
292
309
|
#endif
|
|
293
310
|
|