-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why: We would like to introduce bluetooth to the application for bluetooth based contact tracing. Given the privacy concerns of having both location and bluetooth data available to the same application, google and apple do not allow for both location and bluetooth to be available at the same time. Hence in order to service both location and bluetooth we will need to provide separate apps with separate info.plists and bundle identifiers. At the same time we would like to share a much application logic between the two applications as to reduce the maintenance and organizational overhead. Ideally as close to 100% of the javascript layer is common and for the ios layer we only need to change the info.plists. This commit: Introduces two build targets, GPS and BTE, to the xcode project which are setup to read from the corresponding groups for config and info.plist A COVIDSafePathsConfig file was introduced to expose a 'getTracingStrategy' function to the react native side so that the js runtime can determine which tracing strategy the bundle will be using. This will allow us flexibility to programmatically determine which tracing strategy is being used either within a given react component or to conditional render components altogether. This also allows use to maximize the amount of shared native code. Three schemes where added for each target, a Development, a Staging, and a Production. To build the corresponding targets via the react native cli, you can pass the --scheme flag with the corresponding scheme, e.g: react-native run-ios --scheme "GPS_Development" react-native run-ios --scheme "BTE_Development" We updated the yarn run-ios script in package.json to two scripts for for the gps based build and the bte based build, yarn run-ios-bte and yarn run-ios-gps respectively Note that theres a fair amount of location information storing logic currently in AppDelegate, a future commit might want to refactor this so that the gps specific code is only built in the GPS target builds. We also updated the targets for the tests one for each build target, GPSTests and BTETests respectively. Note that the tests are currently only being run for the GPS version of the app, as the BTE version does not have any different native code at this point.
- Loading branch information
1 parent
2ccb2d4
commit 93cca7d
Showing
32 changed files
with
2,020 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { NativeModules } from 'react-native'; | ||
|
||
export const config = { | ||
tracingStrategy: NativeModules.COVIDSafePathsConfig.getTracingStrategy(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>aps-environment</key> | ||
<string>development</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// COVIDSafePathsConfig.m | ||
// COVIDSafePaths | ||
// | ||
// Created by John Schoeman on 5/17/20. | ||
// Copyright © 2020 Path Check Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "COVIDSafePathsConfig.h" | ||
|
||
@implementation COVIDSafePathsConfig : NSObject | ||
|
||
RCT_EXPORT_MODULE(); | ||
|
||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getAppName) { | ||
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; | ||
} | ||
|
||
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getTracingStrategy) { | ||
return @"bte"; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BGTaskSchedulerPermittedIdentifiers</key> | ||
<array> | ||
<string>com.transistorsoft.fetch</string> | ||
</array> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>COVIDSafePaths-bte</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0.28</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0.28</string> | ||
<key>LSApplicationCategoryType</key> | ||
<string></string> | ||
<key>LSApplicationQueriesSchemes</key> | ||
<array> | ||
<string>itms-apps</string> | ||
</array> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>NSAppTransportSecurity</key> | ||
<dict> | ||
<key>NSAllowsArbitraryLoads</key> | ||
<true/> | ||
<key>NSExceptionDomains</key> | ||
<dict/> | ||
</dict> | ||
<key>NSBluetoothAlwaysUsageDescription</key> | ||
<string>This app uses Bluetooth to securely collect and share random IDs with nearby devices. The app can use these IDs to notify you if you've been exposed to COVID-19</string> | ||
<key>NSBluetoothPeripheralUsageDescription</key> | ||
<string>This app uses Bluetooth to securely collect and share random IDs with nearby devices. The app can use these IDs to notify you if you've been exposed to COVID-19</string> | ||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> | ||
<string>Your location history will be saved on your device, and only shared with others if you choose to do so.</string> | ||
<key>NSLocationAlwaysUsageDescription</key> | ||
<string>Your location history will be saved on your device, and only shared with others if you choose to do so.</string> | ||
<key>NSLocationWhenInUseUsageDescription</key> | ||
<string>Your location history will be saved on your device, and only shared with others if you choose to do so.</string> | ||
<key>NSMainNibFile</key> | ||
<string>LaunchScreen</string> | ||
<key>NSMotionUsageDescription</key> | ||
<string>We use your accelerometer for accurate location history.</string> | ||
<key>UIAppFonts</key> | ||
<array> | ||
<string>IBMPlexSans-Bold.ttf</string> | ||
<string>IBMPlexSans-BoldItalic.ttf</string> | ||
<string>IBMPlexSans-ExtraLight.ttf</string> | ||
<string>IBMPlexSans-ExtraLightItalic.ttf</string> | ||
<string>IBMPlexSans-Italic.ttf</string> | ||
<string>IBMPlexSans-Light.ttf</string> | ||
<string>IBMPlexSans-LightItalic.ttf</string> | ||
<string>IBMPlexSans-Medium.ttf</string> | ||
<string>IBMPlexSans-MediumItalic.ttf</string> | ||
<string>IBMPlexSans.ttf</string> | ||
<string>IBMPlexSans-SemiBold.ttf</string> | ||
<string>IBMPlexSans-SemiBoldItalic.ttf</string> | ||
<string>IBMPlexSans-Thin.ttf</string> | ||
<string>IBMPlexSans-ThinItalic.ttf</string> | ||
<string>IBMPlexMono-Bold.ttf</string> | ||
<string>IBMPlexMono-BoldItalic.ttf</string> | ||
<string>IBMPlexMono-ExtraLight.ttf</string> | ||
<string>IBMPlexMono-ExtraLightItalic.ttf</string> | ||
<string>IBMPlexMono-Italic.ttf</string> | ||
<string>IBMPlexMono-Light.ttf</string> | ||
<string>IBMPlexMono-LightItalic.ttf</string> | ||
<string>IBMPlexMono-Medium.ttf</string> | ||
<string>IBMPlexMono-MediumItalic.ttf</string> | ||
<string>IBMPlexMono.ttf</string> | ||
<string>IBMPlexMono-SemiBold.ttf</string> | ||
<string>IBMPlexMono-SemiBoldItalic.ttf</string> | ||
<string>IBMPlexMono-Thin.ttf</string> | ||
<string>IBMPlexMono-ThinItalic.ttf</string> | ||
</array> | ||
<key>UIBackgroundModes</key> | ||
<array> | ||
<string>bluetooth-central</string> | ||
<string>bluetooth-peripheral</string> | ||
<string>fetch</string> | ||
<string>location</string> | ||
<string>processing</string> | ||
</array> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>armv7</string> | ||
</array> | ||
<key>UIStatusBarStyle</key> | ||
<string>UIStatusBarStyleLightContent</string> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
</array> | ||
<key>UIViewControllerBasedStatusBarAppearance</key> | ||
<false/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>BNDL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0.28</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0.28</string> | ||
</dict> | ||
</plist> |
Oops, something went wrong.