Swift package (iOS)
Add the package by URL in Xcode, or in a manifest:
Current limits:
- The storage providers (the Keychain MLS store and the protocol-state file store) are not yet public, so an application cannot construct them from the package.
- Wiring the transport managers to the engine is the application’s job. A public entry point that does both is planned for this package.
Offline-Protocol/offline-protocol-swift is generated by the SDK’s release workflow; changes made there are overwritten. File issues in the SDK repository. The same release also attaches the XCFramework (offline-protocol-0.32.0-swiftpm-xcframework.zip, offline-protocol-0.32.0-ios-xcframework.zip) and the assembled package (offline-protocol-0.32.0-swift-package.tar.gz).
The iOS peer-stream manager uses Network framework, so the interoperability break with 0.27 applies here as well. Declare the Info.plist keys in iOS peer streams before enabling that transport. From v0.29.0 the iOS Bluetooth LE central writes its hello once per connection, so an iPhone can start a session with a Python host it connects to over Bluetooth LE. From v0.31.0 the iOS peripheral serves the Hello characteristic too, so a central that writes its identity, such as a browser over Web Bluetooth, is bound to its address at once.
Android bindings
From v0.29.0 the Android library is on Maven Central ascom.offlineprotocol:offline-protocol-sdk. Add it to the app module:
It depends on JNA 5.19.1 as an Android archive, and Gradle adds that for you. The React Native module that ties the transports and storage to the engine is not part of it, so wiring them is the application’s job. Artifacts are signed with the Offline Protocol release key, fingerprint
55FD B6AB C147 BD60 9EE0 447D C671 8335 845D 9497.
The same bindings and native libraries are also attached to the v0.32.0 GitHub release as offline-protocol-0.32.0-android.zip, for builds that cannot use Maven Central. The library is built from bindings/kotlin in the SDK repository; see its README.
The Android integration guide shows the bindings in Kotlin.
Bluetooth LE signal strength
From v0.31.0 the engine reports live signal strength for linked Bluetooth LE peers, off by default. Callset_peer_rssi_events(true) (setPeerRssiEvents in Swift and Kotlin) and the engine emits peer_rssi events with the peer’s off1… address, the transport and the reading in dBm, at most four a second per peer. While readings flow, each link’s quality follows the smoothed readings and the mesh relay ranks neighbours by it. A reading is attributed only to a peer that proved its address on a link, and signal strength proves nothing about who sent it, so do not treat it as evidence of who is nearby (threat model R29). The React Native module turns readings on while a peer_rssi listener exists; see events.
Desktop native libraries
The same release attaches the native library forlinux-x86_64, linux-aarch64, macos-arm64 and windows-x86_64. Python users get these inside the PyPI wheels; Rust users build from the crates. From v0.30.0 each desktop archive also carries the C header for the C binding, and the Windows archive the DLL’s import library. The Java and Ruby bindings load the same library.
From v0.30.0 link-time optimisation reaches every shipped library, and the iOS and Android libraries are also built for size. Measured on the macOS arm64 build, link-time optimisation cut the static library behind the iOS framework from 138 MB to 23 MB and the shared library from 11.5 MB to 10.9 MB; building for size took that shared library on to 8.5 MB. Building for size makes CPU-bound work in the SDK slower; see upgrade from v0.29.
