bridgefy-react-native 1.0.1
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 +20 -0
- package/README.md +145 -0
- package/android/build.gradle +105 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +10 -0
- package/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativeModule.kt +323 -0
- package/android/src/main/java/me/bridgefy/plugin/react_native/BridgefyReactNativePackage.kt +17 -0
- package/bridgefy-react-native.podspec +42 -0
- package/ios/BridgefyReactNative-Bridging-Header.h +2 -0
- package/ios/BridgefyReactNative.m +42 -0
- package/ios/BridgefyReactNative.swift +327 -0
- package/ios/BridgefyReactNative.xcodeproj/project.pbxproj +293 -0
- package/ios/Frameworks/BridgefySDK.xcframework/Info.plist +44 -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 +296 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Headers/BridgefySDK.h +15 -0
- 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 +8744 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios.private.swiftinterface +101 -0
- 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 +101 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/BridgefySDK.framework/_CodeSignature/CodeResources +190 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/dSYMs/BridgefySDK.framework.dSYM/Contents/Info.plist +20 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/DWARF/BridgefySDK +0 -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 +588 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Headers/BridgefySDK.h +15 -0
- 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 +8744 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +101 -0
- 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 +101 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +8744 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/BridgefySDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +101 -0
- 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 +101 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/BridgefySDK.framework/_CodeSignature/CodeResources +245 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Info.plist +20 -0
- package/ios/Frameworks/BridgefySDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/BridgefySDK.framework.dSYM/Contents/Resources/DWARF/BridgefySDK +0 -0
- package/lib/commonjs/index.js +184 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +176 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +214 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +162 -0
- package/src/index.tsx +273 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
|
|
3
|
+
// swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name BridgefySDK
|
|
4
|
+
// swift-module-flags-ignorable: -enable-bare-slash-regex
|
|
5
|
+
@_exported import BridgefySDK
|
|
6
|
+
import CommonCrypto
|
|
7
|
+
import CoreBluetooth
|
|
8
|
+
import CryptoKit
|
|
9
|
+
import Foundation
|
|
10
|
+
import Swift
|
|
11
|
+
import UIKit
|
|
12
|
+
import _Concurrency
|
|
13
|
+
import _StringProcessing
|
|
14
|
+
public class Bridgefy {
|
|
15
|
+
public init(withApiKey apiKey: Swift.String, propagationProfile: BridgefySDK.PropagationProfile = .standard, delegate: any BridgefySDK.BridgefyDelegate, verboseLogging: Swift.Bool = false) throws
|
|
16
|
+
@objc deinit
|
|
17
|
+
public func start()
|
|
18
|
+
public func stop()
|
|
19
|
+
public func destroySession()
|
|
20
|
+
public func send(_ data: Foundation.Data, using transmissionMode: BridgefySDK.TransmissionMode) throws -> Foundation.UUID
|
|
21
|
+
public func updateLicense()
|
|
22
|
+
public func establishSecureConnection(with userId: Foundation.UUID)
|
|
23
|
+
public var currentUserId: Foundation.UUID {
|
|
24
|
+
get
|
|
25
|
+
}
|
|
26
|
+
public var connectedPeers: [Foundation.UUID] {
|
|
27
|
+
get
|
|
28
|
+
}
|
|
29
|
+
public var licenseExpirationDate: Foundation.Date? {
|
|
30
|
+
get
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
public enum BridgefyError : Swift.Error {
|
|
34
|
+
case simulatorIsNotSupported
|
|
35
|
+
case notStarted
|
|
36
|
+
case alreadyInstantiated
|
|
37
|
+
case startInProgress
|
|
38
|
+
case alreadyStarted
|
|
39
|
+
case serviceNotStarted
|
|
40
|
+
case missingBundleID
|
|
41
|
+
case invalidAPIKey
|
|
42
|
+
case internetConnectionRequired
|
|
43
|
+
case sessionError
|
|
44
|
+
case expiredLicense
|
|
45
|
+
case inconsistentDeviceTime
|
|
46
|
+
case BLEUsageNotGranted
|
|
47
|
+
case BLEUsageRestricted
|
|
48
|
+
case BLEPoweredOff
|
|
49
|
+
case BLEUnsupported
|
|
50
|
+
case BLEUnknownError
|
|
51
|
+
case inconsistentConnection
|
|
52
|
+
case connectionIsAlreadySecure
|
|
53
|
+
case cannotCreateSecureConnection
|
|
54
|
+
case dataLengthExceeded
|
|
55
|
+
case dataValueIsEmpty
|
|
56
|
+
case peerIsNotConnected
|
|
57
|
+
case internalError
|
|
58
|
+
case licenseError(code: Swift.Int)
|
|
59
|
+
case storageError(code: Swift.Int)
|
|
60
|
+
case encodingError(code: Swift.Int)
|
|
61
|
+
case encryptionError(code: Swift.Int)
|
|
62
|
+
}
|
|
63
|
+
extension BridgefySDK.BridgefyError : Foundation.LocalizedError {
|
|
64
|
+
public var errorDescription: Swift.String? {
|
|
65
|
+
get
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
public enum PropagationProfile {
|
|
69
|
+
case standard
|
|
70
|
+
case highDensityNetwork
|
|
71
|
+
case sparseNetwork
|
|
72
|
+
case longReach
|
|
73
|
+
case shortReach
|
|
74
|
+
public static func == (a: BridgefySDK.PropagationProfile, b: BridgefySDK.PropagationProfile) -> Swift.Bool
|
|
75
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
76
|
+
public var hashValue: Swift.Int {
|
|
77
|
+
get
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
public enum TransmissionMode {
|
|
81
|
+
case p2p(userId: Foundation.UUID)
|
|
82
|
+
case mesh(userId: Foundation.UUID)
|
|
83
|
+
case broadcast(senderId: Foundation.UUID)
|
|
84
|
+
}
|
|
85
|
+
public protocol BridgefyDelegate : AnyObject {
|
|
86
|
+
func bridgefyDidStart(with userId: Foundation.UUID)
|
|
87
|
+
func bridgefyDidFailToStart(with error: BridgefySDK.BridgefyError)
|
|
88
|
+
func bridgefyDidStop()
|
|
89
|
+
func bridgefyDidFailToStop(with error: BridgefySDK.BridgefyError)
|
|
90
|
+
func bridgefyDidDestroySession()
|
|
91
|
+
func bridgefyDidFailToDestroySession()
|
|
92
|
+
func bridgefyDidConnect(with userId: Foundation.UUID)
|
|
93
|
+
func bridgefyDidDisconnect(from userId: Foundation.UUID)
|
|
94
|
+
func bridgefyDidEstablishSecureConnection(with userId: Foundation.UUID)
|
|
95
|
+
func bridgefyDidFailToEstablishSecureConnection(with userId: Foundation.UUID, error: BridgefySDK.BridgefyError)
|
|
96
|
+
func bridgefyDidSendMessage(with messageId: Foundation.UUID)
|
|
97
|
+
func bridgefyDidFailSendingMessage(with messageId: Foundation.UUID, withError error: BridgefySDK.BridgefyError)
|
|
98
|
+
func bridgefyDidReceiveData(_ data: Foundation.Data, with messageId: Foundation.UUID, using transmissionMode: BridgefySDK.TransmissionMode)
|
|
99
|
+
}
|
|
100
|
+
extension BridgefySDK.PropagationProfile : Swift.Equatable {}
|
|
101
|
+
extension BridgefySDK.PropagationProfile : Swift.Hashable {}
|
|
Binary file
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
|
|
3
|
+
// swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name BridgefySDK
|
|
4
|
+
// swift-module-flags-ignorable: -enable-bare-slash-regex
|
|
5
|
+
@_exported import BridgefySDK
|
|
6
|
+
import CommonCrypto
|
|
7
|
+
import CoreBluetooth
|
|
8
|
+
import CryptoKit
|
|
9
|
+
import Foundation
|
|
10
|
+
import Swift
|
|
11
|
+
import UIKit
|
|
12
|
+
import _Concurrency
|
|
13
|
+
import _StringProcessing
|
|
14
|
+
public class Bridgefy {
|
|
15
|
+
public init(withApiKey apiKey: Swift.String, propagationProfile: BridgefySDK.PropagationProfile = .standard, delegate: any BridgefySDK.BridgefyDelegate, verboseLogging: Swift.Bool = false) throws
|
|
16
|
+
@objc deinit
|
|
17
|
+
public func start()
|
|
18
|
+
public func stop()
|
|
19
|
+
public func destroySession()
|
|
20
|
+
public func send(_ data: Foundation.Data, using transmissionMode: BridgefySDK.TransmissionMode) throws -> Foundation.UUID
|
|
21
|
+
public func updateLicense()
|
|
22
|
+
public func establishSecureConnection(with userId: Foundation.UUID)
|
|
23
|
+
public var currentUserId: Foundation.UUID {
|
|
24
|
+
get
|
|
25
|
+
}
|
|
26
|
+
public var connectedPeers: [Foundation.UUID] {
|
|
27
|
+
get
|
|
28
|
+
}
|
|
29
|
+
public var licenseExpirationDate: Foundation.Date? {
|
|
30
|
+
get
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
public enum BridgefyError : Swift.Error {
|
|
34
|
+
case simulatorIsNotSupported
|
|
35
|
+
case notStarted
|
|
36
|
+
case alreadyInstantiated
|
|
37
|
+
case startInProgress
|
|
38
|
+
case alreadyStarted
|
|
39
|
+
case serviceNotStarted
|
|
40
|
+
case missingBundleID
|
|
41
|
+
case invalidAPIKey
|
|
42
|
+
case internetConnectionRequired
|
|
43
|
+
case sessionError
|
|
44
|
+
case expiredLicense
|
|
45
|
+
case inconsistentDeviceTime
|
|
46
|
+
case BLEUsageNotGranted
|
|
47
|
+
case BLEUsageRestricted
|
|
48
|
+
case BLEPoweredOff
|
|
49
|
+
case BLEUnsupported
|
|
50
|
+
case BLEUnknownError
|
|
51
|
+
case inconsistentConnection
|
|
52
|
+
case connectionIsAlreadySecure
|
|
53
|
+
case cannotCreateSecureConnection
|
|
54
|
+
case dataLengthExceeded
|
|
55
|
+
case dataValueIsEmpty
|
|
56
|
+
case peerIsNotConnected
|
|
57
|
+
case internalError
|
|
58
|
+
case licenseError(code: Swift.Int)
|
|
59
|
+
case storageError(code: Swift.Int)
|
|
60
|
+
case encodingError(code: Swift.Int)
|
|
61
|
+
case encryptionError(code: Swift.Int)
|
|
62
|
+
}
|
|
63
|
+
extension BridgefySDK.BridgefyError : Foundation.LocalizedError {
|
|
64
|
+
public var errorDescription: Swift.String? {
|
|
65
|
+
get
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
public enum PropagationProfile {
|
|
69
|
+
case standard
|
|
70
|
+
case highDensityNetwork
|
|
71
|
+
case sparseNetwork
|
|
72
|
+
case longReach
|
|
73
|
+
case shortReach
|
|
74
|
+
public static func == (a: BridgefySDK.PropagationProfile, b: BridgefySDK.PropagationProfile) -> Swift.Bool
|
|
75
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
76
|
+
public var hashValue: Swift.Int {
|
|
77
|
+
get
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
public enum TransmissionMode {
|
|
81
|
+
case p2p(userId: Foundation.UUID)
|
|
82
|
+
case mesh(userId: Foundation.UUID)
|
|
83
|
+
case broadcast(senderId: Foundation.UUID)
|
|
84
|
+
}
|
|
85
|
+
public protocol BridgefyDelegate : AnyObject {
|
|
86
|
+
func bridgefyDidStart(with userId: Foundation.UUID)
|
|
87
|
+
func bridgefyDidFailToStart(with error: BridgefySDK.BridgefyError)
|
|
88
|
+
func bridgefyDidStop()
|
|
89
|
+
func bridgefyDidFailToStop(with error: BridgefySDK.BridgefyError)
|
|
90
|
+
func bridgefyDidDestroySession()
|
|
91
|
+
func bridgefyDidFailToDestroySession()
|
|
92
|
+
func bridgefyDidConnect(with userId: Foundation.UUID)
|
|
93
|
+
func bridgefyDidDisconnect(from userId: Foundation.UUID)
|
|
94
|
+
func bridgefyDidEstablishSecureConnection(with userId: Foundation.UUID)
|
|
95
|
+
func bridgefyDidFailToEstablishSecureConnection(with userId: Foundation.UUID, error: BridgefySDK.BridgefyError)
|
|
96
|
+
func bridgefyDidSendMessage(with messageId: Foundation.UUID)
|
|
97
|
+
func bridgefyDidFailSendingMessage(with messageId: Foundation.UUID, withError error: BridgefySDK.BridgefyError)
|
|
98
|
+
func bridgefyDidReceiveData(_ data: Foundation.Data, with messageId: Foundation.UUID, using transmissionMode: BridgefySDK.TransmissionMode)
|
|
99
|
+
}
|
|
100
|
+
extension BridgefySDK.PropagationProfile : Swift.Equatable {}
|
|
101
|
+
extension BridgefySDK.PropagationProfile : Swift.Hashable {}
|