AppWebViewModel

abstract class AppWebViewModel : ViewModel, AppWebViewClient.WebClientCallback, Communication

Types

BiometricRequest
Link copied to clipboard
class BiometricRequest(@StringRes title: Int, onSuccess: () -> Unit, onFailure: (errorCode: Int, errString: CharSequence) -> Unit)
BiometryMethod
Link copied to clipboard
enum BiometryMethod : Enum<AppWebViewModel.BiometryMethod>

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.

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

Requests to close the current PWA.

closeApp
Link copied to clipboard
abstract fun closeApp()
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.

getTag
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
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.

init
Link copied to clipboard
abstract fun init(url: String)
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.

onCleared
Link copied to clipboard
open fun onCleared()
onClose
Link copied to clipboard
abstract fun onClose()

Invoked when the WebClient catch a close URI.

onLoadingChanged
Link copied to clipboard
abstract fun onLoadingChanged(isLoading: Boolean)

Invoked when the page has started or finished loading.

onSwitchErrorState
Link copied to clipboard
abstract fun onSwitchErrorState(isError: Boolean, isHttpError: Boolean)

Invoked when the WebClient changes it's error state (e.g. a website that couldn't be loaded previously is now ready).

onUrlChanged
Link copied to clipboard
abstract fun onUrlChanged(newUrl: String)

Invoked when the URL has changed.

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.

setTagIfAbsent
Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T
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.

Properties

biometricRequest
Link copied to clipboard
abstract val biometricRequest: LiveData<Event<AppWebViewModel.BiometricRequest>>
currentUrl
Link copied to clipboard
abstract val currentUrl: MutableLiveData<String?>
goBack
Link copied to clipboard
abstract val goBack: LiveData<Event<Unit>>
init
Link copied to clipboard
abstract val init: LiveData<Event<String>>
isInErrorState
Link copied to clipboard
abstract val isInErrorState: LiveData<Event<Boolean>>
loadUrl
Link copied to clipboard
abstract val loadUrl: LiveData<Event<String>>
showLoadingIndicator
Link copied to clipboard
abstract val showLoadingIndicator: LiveData<Event<Boolean>>

Inheritors

AppWebViewModelImpl
Link copied to clipboard