DP3T native bindings for React Native.
Pre-alpha. Requires some manual setup to work. Not tested yet. Can change without notice.
The iOS SDK and Android SDK themselves are in alpha state.
This project is bootstraped from bob, see implementation notes.
Right now you need to clone it or add it with its Git URL, and build it with yarn bootstrap
.
This lib does not work on emulators or simulators, and will crash or burn incomprehensibly. Run on physical devices.
Customize the tracing notification as in the Android SDK
You have to make changes in build.gradle
:
minSdkVersion
to 23 or above, as the Android DP3T SDK dos not support lower versions.compileSdkVersion
to 29 or above, to fulfill the requirement forandroid:foregroundServiceType
in Android Q (set by the Android DP3T SDK).
The lib automatically sets the android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
permission.
The lib also ask the user to add your app to the battery optimization whitelist for you when you call Dp3t.init()
.
The Play Store usually prohibits this, so you need to make sure the Play Store filing explains why this is necessary. This may only be necessary until the Android SDK uses official Google DP3T support, in which case we will adapt the permissions & warnings in this section.
Minimum iOS version is 11 for DP3T iOS SDK, so you need to change the verison to (at least) 11.0 in your iOS Podfile.
You have to add the react-native-swift package and run react-native swiftify
and run pod install
again, because this native module (and the DP3T iOS SDK) use Swift.
Add bluetooth capabilities to your Info.plist file.
Add background fetch configuration to your Info.plist file.
You have to add pod 'DP3TSDK', :git => "https://github.com/DP-3T/dp3t-sdk-ios.git", :commit => 'COMMIT_ID''
in your Podfile until the SDK stabilizes, and a version is pushed on the Pods repo.
Replace COMMIT_ID
with 13c009500dccd1488131a6b0c8ae69247b33a9b0
(latest version supported, watch this file to follow the changes)
This implementation does not yet support requesting the permissions to use Bluetooth in iOS.
iOS SDK does not sync keys automatically. These bindings do not attempt to sync automatically either: you need to call Dp3t.sync() manually.
import Dp3t from 'react-native-dp3t';
// ...
const deviceName = await Dp3t.getDeviceName();
MIT
Wix incubator is building a RN lib from scratch (they don't use DP3T SDK)