Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 5.96 KB

JavaScriptBridge.md

File metadata and controls

54 lines (41 loc) · 5.96 KB

JavaScript Bridge Documentation

When application is running, it uses NativeBridgeInterface to interact with web application(PWA).

Contract with PWA:

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
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
}