cds-snc / covid-alert-app
- воскресенье, 2 августа 2020 г. в 00:24:30
TypeScript
Exposure notification client application / Application client de notification d'exposition
Adapted from https://github.com/CovidShield/mobile (upstream)
This repository implements a React Native client application for Apple/Google's Exposure Notification framework, informed by the guidance provided by Canada's Privacy Commissioners.
This app is built using React Native and designed to work well with patterns on both Android and iOS devices. It works alongside the COVID Alert Diagnosis Server to provide a reference for how a client application for exposure notifications could work.
Follow the steps outlined in React Native Development Environment Setup to make sure you have the proper tools installed.
"com.google.android.apps.exposurenotification". Go to Environment config to see how to change APPLICATION_ID.git clone git@github.com:cds-snc/covid-shield-mobile.gityarn installsudo gem install cocoapodsbundle install && yarn pod-installCheck .env and adjust configuration if necessary. See react-native-config for more information.
Ex:
ENVFILE=.env.production yarn run-ios
ENVFILE=.env.production yarn run-androidYou can now launch the app using the following commands for both iOS and Android.
yarn run-ios
yarn run-androidYou can also build the app with native development tool:
CovidShield.xcworkspace file in the ios folder.android folder.When the app is running development mode, you can tap on the COVID Alert logo at the top of the app to open the Test menu. This menu enables you to:
Note that: Test menu is enabled if the environment config file (.env*) has TEST_MODE=true. To disable test mode UI on production build, simply set it to false in the environment config file TEST_MODE=false.
If you would like to:
Please add the following keys to the info.plist file. These keys should not be commited to the repo, and used only for local development.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<false/>
</dict>
You can customize the look and feel of the app largely by editing values found in the Theme File.
The COVID Alert app is available in French and English. Fully localized content can be modified by editing translations files found in the translations directory. More translations can be added by using the same mechanism as French and English.
After modifying the content you must run the generate-translations command in order for the app to reflect your changes.
yarn generate-translationspt in translations.js.yarn generate-translations.Localizations settings (Project -> CovidShield -> Info tab -> Localizations) and make sure Launch Screen.storyboard is checked.COVID Alert was originally developed by volunteers at Shopify. It was released free of charge under a flexible open-source license.
This repository is being developed by the Canadian Digital Service. We can be reached at cds-snc@tbs-sct.gc.ca.
Logs
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "/Users/YOUR_USER/.android/debug.keystore": keystore password was incorrectGenerate a new debug.keystore:
cd android/app
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000Copy your debug.keystore to ~/.android/debug.keystore:
cd android/app
cp debug.keystore ~/.android/debug.keystoreNow you can run yarn run-android in your root folder.
When following step 2.1.1 Install Cocoapods if you recieve an error that looks like the following (Please Note: Error message will not be identical but simliar):
ERROR: Loading command: install (LoadError)
dlopen(/Users/$home/ruby/2.6.5/x86_64-darwin18/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/$home/ruby/2.6.5/x86_64-darwin18/openssl.bundle
ERROR: While executing gem ... (NoMethodError)This is because the version of Ruby you have installed does not have OpenSSL included.
You can fix this error by installing Ruby Version Manager (if you do not already have it), and reinstalling the version of ruby required with OpenSSL using the following steps:
rvm reinstall 2.6.5 --with-openssl-dir=/usr/local/opt/opensslYou should now be able to install cocoapods and gem commands should now work.
Adapté de https://github.com/CovidShield/mobile (voir les modifications)
Ce dépôt met en œuvre une application client React Native pour le cadriciel Notification d’exposition d’Apple/Google, éclairé par l’orientation fournie par le commissaire à la protection de la vie privée du Canada.
Cette application est construite à l’aide de React Native et est conçue pour bien fonctionner avec des modèles sur les appareils Android et iOS. Elle fonctionne de concert avec le Serveur de diagnostic Alerte COVID pour fournir une référence sur le fonctionnement possible d’une application client pour les notifications d’exposition.
Suivez les étapes décrites dans Configuration de l’environnement de développement React Native pour vous assurer que les outils appropriés sont installés.
« com.google.android.apps.exposurenotification ». Aller à Environment config pour voir comment modifier l’APPLICATION_ID.git clone git@github.com:cds-snc/covid-shield-mobile.gityarn installsudo gem install cocoapodsbundle install && yarn pod-installCocher .env et rajuster la configuration si nécessaire. Voir react-native-config pour plus d’information.
Exemple :
ENVFILE=.env.production yarn run-ios
ENVFILE=.env.production yarn run-androidVous pouvez maintenant lancer l’application à l’aide des commandes suivantes pour iOS et Android :
yarn run-ios
yarn run-androidVous pouvez également construire l’application avec un outil de développement natif :
CovidShield.xcworkspace dans le dossier « ios ».android.Lorsque l’application est en mode de développement, vous pouvez appuyer sur le logo Alerte COVID en haut de l’application pour ouvrir le menu Test. Ce menu vous permet de :
Remarque : Le menu de test est activé si le fichier de configuration de l’environnement (.env*) montre « TEST_MODE=true ». Pour désactiver l’interface utilisateur du mode test en production, il suffit de la définir comme False dans le fichier de configuration d’environnement « TEST_MODE=false ».
Vous pouvez personnaliser l’apparence de l’application en grande partie en modifiant les valeurs du Theme File.
L’application Alerte COVID est disponible en français et en anglais. Le contenu entièrement localisé peut être modifié en modifiant les fichiers de traduction qui se trouvent dans le répertoire des traductions. On peut ajouter plus de traductions en utilisant le même mécanisme pour le français et l’anglais.
Après avoir modifié le contenu, vous devez exécuter la commande generate-translations pour que l’application reflète vos modifications.
yarn generate-translationspt dans translations.js.yarn generate-translations.Localizations (Project -> CovidShield -> onglet Info -> Localizations) et assurez-vous que Launch Screen.storyboard est coché.Alerte COVID a été développé à l’origine par des bénévoles de Shopify. Il a été diffusé gratuitement en vertu d’une licence ouverte flexible.
Ce dépôt est maintenu par le Service numérique canadien. Vous pouvez nous joindre à cds-snc@tbs-sct.gc.ca.
Journaux
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "/Users/YOUR_USER/.android/debug.keystore": keystore password was incorrectCréer un nouveau debug.keystore :
cd android/app
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000Copiez votre debug.keystore sur ~/.android/debug.keystore :
cd android/app
cp debug.keystore ~/.android/debug.keystoreVous pouvez maintenant exécuter yarn run-android dans votre dossier racine.