AppCallbackImpl

abstract class AppCallbackImpl : AppCallback, CloudSDKKoinComponent

Functions

getAccessToken
Link copied to clipboard
open override fun getAccessToken(reason: InvalidTokenReason, oldToken: String?, onResult: (GetAccessTokenResponse) -> Unit)

Is called when the app sends the access token is invalid action. The client app needs to call the onResult function to set the GetAccessTokenResponse.

getConfig
Link copied to clipboard
open override fun getConfig(key: String, config: (String?) -> Unit)

Is called when the app requests a configuration.

getKoin
Link copied to clipboard
open override fun getKoin(): Koin
isAppRedirectAllowed
Link copied to clipboard
open override fun isAppRedirectAllowed(app: String, isAllowed: (Boolean) -> Unit)

Is called whenever the current app tries to redirect to another specified app. The client app can then decide, if this should be allowed (set isAllowed to true) or if the client intercepts the app (set isAllowed to false), e.g. native apps with a map probably don't want to show the fuel station finder, but show their own map instead.

isRemoteConfigAvailable
Link copied to clipboard
open override fun isRemoteConfigAvailable(isAvailable: (Boolean) -> Unit)

Is called when the app wants to know if the remote config feature is generally available.

isSignedIn
Link copied to clipboard
open override fun isSignedIn(isSignedIn: (Boolean) -> Unit)

Is called when the app wants to know if the user is potentially signed in without triggering an actual sign in action.

logEvent
Link copied to clipboard
open override fun logEvent(key: String, parameters: Map<String, Any>)

Is called when the app sends an event to be logged.

onClose
Link copied to clipboard
open override fun onClose()

Is called when the app needs to get closed (e.g. when it is not available anymore).

onCustomSchemeError
Link copied to clipboard
open override fun onCustomSchemeError(context: Context?, scheme: String)

Is called when the client app hasn't set up deep linking via a custom scheme, which the app is trying to trigger, and passes the scheme for which it failed.

onDisable
Link copied to clipboard
open override fun onDisable(host: String)

Is called when the app sends the disable action.

onImageDataReceived
Link copied to clipboard
open override fun onImageDataReceived(bitmap: Bitmap)

Is called when the app sends an image. If it is not overwritten, it opens the image in the system share sheet.

onLogin
Link copied to clipboard
open override fun onLogin(context: Context, result: Completion<String?>)

Is called when the user logs in via an automatic authorization request from the SDK within the PWA. This callback can be used to display an AlertDialog after an authorization within the PWA, for which the AppActivity context is needed.

onLogout
Link copied to clipboard
open override fun onLogout(onResult: (LogoutResponse) -> Unit)

Is called when the app sends a request to logout the current user. The client app needs to call the onResult function to set the LogoutResponse. Use LogoutResponse.SUCCESSFUL to signal a successful logout, LogoutResponse.UNAUTHORIZED if the user was not logged in at all and LogoutResponse.OTHER for all other errors.

onOpen
Link copied to clipboard
open override fun onOpen(app: App?)

Is called when the app was opened (e.g. by clicking the cloud.pace.sdk.appkit.app.drawer.AppDrawer).

onOpenInNewTab
Link copied to clipboard
open override fun onOpenInNewTab(url: String)

Is called when the app sends the open URL in new tab action.

onSessionRenewalFailed
Link copied to clipboard
open override fun onSessionRenewalFailed(throwable: Throwable?, onResult: (String?) -> Unit)

Is called if an automatic session renewal triggered by the SDK itself fails. The client app needs to call the onResult function to set a new access token or null in case of error.

onShareTextReceived
Link copied to clipboard
open override fun onShareTextReceived(text: String, title: String)

Is called when the app sends a text to share. If it is not overwritten, it opens the system share sheet.

setUserProperty
Link copied to clipboard
open override fun setUserProperty(key: String, value: String, update: Boolean)

Is called when the app sends a user property.