-
Notifications
You must be signed in to change notification settings - Fork 43
JavaScript bridge documentation
Artur Slomowski edited this page Jun 9, 2020
·
1 revision
When application is running, it uses NativeBridgeInterface to interact with web application(PWA).
- JavaScript → Native:
- Native -> JavaScript:
Contract with PWA:
- function getBridgeData is handled by OnGetBridgeDataUseCase
| Data type | Description | Response JSON format |
|---|---|---|
| OutgoingBridgeDataType.NOTIFICATION_DATA | Request content of current notification UseCase GetNotificationDataAndClearUseCase |
{"data": "JSON with notification data"}
|
| OutgoingBridgeDataType.ANALYZE_RESULT | Request the highest risk level of exposure UseCaseGetAnalyzeResultUseCase |
{"riskLevel" : 1 //1- no risk, 2-middle risk, 3-high risk}
|
| OutgoingBridgeDataType.SERVICES_STATUS | Request statuses of services UseCaseGetServicesStatusUseCase |
"servicesStatus": {"exposureNotificationStatus": 1 - ON, 2 - OFF, 3 - NOT SUPPORTED,"isLocationOn": true/false,"isBtOn": true/false,"isNotificationEnabled": true/false}
|
Parameters in service status response:
| Json parameter | Description |
|---|---|
| exposureNotificationStatus | Status of Exposure Notification Framework |
| isLocationOn | Is Location service enabled |
| isBtOn | Is Bluetooth service enabled |
| isNotificationEnabled | Can notification be presented |
- function setBridgeData is handled by OnSetBridgeDataUseCase
| Data type | Description | Request JSON format |
|---|---|---|
| IncomingBridgeDataType.TRIAGE | Save triage finished timestamp UseCaseSaveTriageCompletedUseCase |
{“timestamp” = 1589669050}
|
| IncomingBridgeDataType.REQUEST_CLEAR_EXPOSURE_NOTIFICATIONS_DATA | Clear application data UseCaseClearExposureNotificationDataUseCase |
{“clearBtData” = true/false}
|
| IncomingBridgeDataType.REQUEST_TEMPORARY_EXPOSURE_KEYS_UPLOAD | Upload Temporary Exposure Keys UseCaseUploadTemporaryExposureKeysUseCase |
{“pin” : “123FAA”}
|
| IncomingBridgeDataType.REQUEST_SERVICE_STATUS_CHANGE | Enable mentioned service UseCaseChangeServiceStatusUseCase |
{{“enableExposureNotificationService” = true/false, //optional"enableBt" = true, //optional"enableLocation" = true, //optional"enableNotification" = true //optional}}
|
Parameters in service status change request:
| Json parameter | Description |
|---|---|
| enableExposureNotificationService | Enable/Disable Exposure Notification Framework |
| enableBt | Enable Bluetooth service |
| enableLocation | Enable Location service |
| enableNotification | Enable notifications |
- function onBridgeData
| Data type | Description | JSON format |
|---|---|---|
| OutgoingBridgeDataType.APP_LIFECYCLE_STATE | Send lifecycle state UseCase ComposeAppLifecycleStateBrideDataUseCase |
{“appState” : 1(Active)/2(Inactive)}
|
| OutgoingBridgeDataType.TEMPORARY_EXPOSURE_KEYS_UPLOAD_STATUS | Send state of uploading process UseCase UploadTemporaryExposureKeysWithCachedPayloadUseCase |
{“result“ : 1(SUCCESS)/2(FAILED),3(PROBLEM)}
|
| OutgoingBridgeDataType.SERVICES_STATUS | Send statuses of services UseCase GetServicesStatusUseCase |
"servicesStatus": {"exposureNotificationStatus": 1 - ON, 2 - OFF, 3 - NOT SUPPORTED,"isLocationOn": true/false,"isBtOn": true/false,"isNotificationEnabled": true/false}
|
Android Documentation
- README
- Controlling exposure notification
- Receiving exposures documentation
- JavaScript bridge documentation
- Providing diagnosis keys
- Downloading diagnosis keys
- Removing historical data
- Reporting risk level
- Temporary exposure keys upload
About ProteGo
- Introduction
- SARS-CoV-2 infection risk groups
- Anonymity and security
- Further principles
- Version 2.0 functionalities scope
- Version 3.0 functionalities scope
- Version 4.0 functionalities scope
- ProteGO Safe and it’s documentation is licensed under
- Dictionary
Contributing
- How to contribute
- Code of conduct
- Feature request template
- Pull request template
- Issue template
- Security
- Support
- Contributors
- License
ProteGo Repositories