Communication

interface Communication

Used for receiving messages from the PWA. These methods are called when the listener is registered with the CommunicationManager.

Functions

appInterceptableLink
Link copied to clipboard
abstract suspend fun appInterceptableLink(timeout: Long?): AppInterceptableLinkResult

Some services (e.g. Paypal) will be opened independently from the web app, see "openURLInNewTab". On completion, the flow will be redirected to the schema provided to this request. This needs to be a unique identifier, e.g. "pace.some_uuid".

applePayAvailabilityCheck
Link copied to clipboard
abstract suspend fun applePayAvailabilityCheck(timeout: Long?, applePayAvailabilityCheckRequest: ApplePayAvailabilityCheckRequest): ApplePayAvailabilityCheckResult

Requests, if Apple Pay is ready to be used (enabled + cards onboarded; iOS only)

applePayRequest
Link copied to clipboard
abstract suspend fun applePayRequest(timeout: Long?, applePayRequestRequest: ApplePayRequestRequest): ApplePayRequestResult

The Apple Pay payment request to be handled (iOS only).

appRedirect
Link copied to clipboard
abstract suspend fun appRedirect(timeout: Long?, appRedirectRequest: AppRedirectRequest): AppRedirectResult

Asks the client for permission to redirect to another web app than the current one. The client can decide whether the app switch should be allowed or disallowed and intercepted by the client (e.g. a client with an own map might not want the web app to redirect to the fuel-station-finder). By default, redirects should always be allowed.

back
Link copied to clipboard
abstract suspend fun back(timeout: Long?): BackResult

The app requests navigating back.

close
Link copied to clipboard
abstract suspend fun close(timeout: Long?): CloseResult

Requests to close the current PWA.

disable
Link copied to clipboard
abstract suspend fun disable(timeout: Long?, disableRequest: DisableRequest): DisableResult

The current app will no longer be displayed up until the given date.

getAccessToken
Link copied to clipboard
abstract suspend fun getAccessToken(timeout: Long?, getAccessTokenRequest: GetAccessTokenRequest): GetAccessTokenResult

Requests a fresh access token for the currently authenticated user.

getBiometricStatus
Link copied to clipboard
abstract suspend fun getBiometricStatus(timeout: Long?): GetBiometricStatusResult

Requests the biometric status, i.e. whether biometric authentication is possible (e.g. via fingerprint or face recognition).

getConfig
Link copied to clipboard
abstract suspend fun getConfig(timeout: Long?, getConfigRequest: GetConfigRequest): GetConfigResult

Requests a configuration value which was defined externally (e.g. via Firebase). Note that the value will always be returned as a string, regardless of the actual type.

getLocation
Link copied to clipboard
abstract suspend fun getLocation(timeout: Long?): GetLocationResult

Requests the current user location as provided by e.g. GPS.

getSecureData
Link copied to clipboard
abstract suspend fun getSecureData(timeout: Long?, getSecureDataRequest: GetSecureDataRequest): GetSecureDataResult

Retrieve a previously saved string value by key. The user should authenticate the access to the string e.g. with biometric authentication.

getTOTP
Link copied to clipboard
abstract suspend fun getTOTP(timeout: Long?, getTOTPRequest: GetTOTPRequest): GetTOTPResult

Return a TOTP generated by previously saved TOTP secret data for the specified key. The user should authenticate the access to the secret data e.g. with biometric authentication.

getTraceId
Link copied to clipboard
abstract suspend fun getTraceId(timeout: Long?): GetTraceIdResult

Requests a unique identifier for the user session for tracing purposes. This must return a new unique value on every call.

imageData
Link copied to clipboard
abstract suspend fun imageData(timeout: Long?, imageDataRequest: ImageDataRequest): ImageDataResult

Send an base64 encoded png image for sharing with the user.

introspect
Link copied to clipboard
abstract suspend fun introspect(timeout: Long?): IntrospectResult

Requests a collection of the supported version and operations.

isBiometricAuthEnabled
Link copied to clipboard
abstract suspend fun isBiometricAuthEnabled(timeout: Long?): IsBiometricAuthEnabledResult

Checks if biometric authentication is enabled.

isRemoteConfigAvailable
Link copied to clipboard
abstract suspend fun isRemoteConfigAvailable(timeout: Long?): IsRemoteConfigAvailableResult

Checks if remote config is available.

isSignedIn
Link copied to clipboard
abstract suspend fun isSignedIn(timeout: Long?): IsSignedInResult

Checks if user is signed in.

logEvent
Link copied to clipboard
abstract suspend fun logEvent(timeout: Long?, logEventRequest: LogEventRequest): LogEventResult

Requests to log an event to the analytics backend (e.g. Firebase).

logout
Link copied to clipboard
abstract suspend fun logout(timeout: Long?): LogoutResult

Requests to logout the current user.

openURLInNewTab
Link copied to clipboard
abstract suspend fun openURLInNewTab(timeout: Long?, openURLInNewTabRequest: OpenURLInNewTabRequest): OpenURLInNewTabResult

Open the given url in a new browser tab. This specifically is the case when authorizing the payment process via paypal due to security reasons.

setSecureData
Link copied to clipboard
abstract suspend fun setSecureData(timeout: Long?, setSecureDataRequest: SetSecureDataRequest): SetSecureDataResult

Requests to save a string securely on the device for later retrieval.

setTOTP
Link copied to clipboard
abstract suspend fun setTOTP(timeout: Long?, setTOTPRequest: SetTOTPRequest): SetTOTPResult

Requests to save TOTP secret data on the device for later retrieval.

setUserProperty
Link copied to clipboard
abstract suspend fun setUserProperty(timeout: Long?, setUserPropertyRequest: SetUserPropertyRequest): SetUserPropertyResult

Requests to set a user property for the current user in the analytics backend (e.g. Firebase).

shareText
Link copied to clipboard
abstract suspend fun shareText(timeout: Long?, shareTextRequest: ShareTextRequest): ShareTextResult

Request to offer the user to share a text via the native share sheet

verifyLocation
Link copied to clipboard
abstract suspend fun verifyLocation(timeout: Long?, verifyLocationRequest: VerifyLocationRequest): VerifyLocationResult

In specific situations the app needs the user's current location to be verified in order to continue its flow.

Inheritors

AppWebViewModel
Link copied to clipboard