Launch Feature

Launch Feature Request

The launch feature flow is initiated by calling FeatureManager.launchFeature() with a FeatureRequest built via the Builder API. Unlike verify(), launchFeature() requires featureId to identify which feature to launch, and does not perform a credential exchange.

val request = FeatureRequest.Builder()
    .requestId("REQ-${System.currentTimeMillis()}")
    .featureId("some-feature-id")
    .userCorrelationId("corr-5678")
    .token("host-app-token")
    .build()

Field nameDescription
requestIdUnique identifier for the request, generated by the client. Required — FeatureCallback.onError(GPE-2206) is invoked if blank.
featureIdIdentifier of the feature to launch. Required — FeatureCallback.onError(GPE-2206) is invoked if blank.
userCorrelationIdIdentifier linking the client user to GoPay. Required — FeatureCallback.onError(GPE-2206) is invoked if blank.
tokenThe linking token for the user. Required — FeatureCallback.onError(GPE-2206) is invoked if blank.
additionalDataOptional key-value metadata forwarded to the backend, same as verify(). Pass null if not required.

Note: FeatureRequest.build() does not validate fields. Validation happens inside launchFeature()featureId, userCorrelationId, requestId, and token are all required; missing any of them results in FeatureCallback.onError being called with GPE-2206, not an exception.

Launch Feature Response

FeatureCallback.onComplete is invoked with a LaunchResult upon completion of the flow.

data class LaunchResult(
    val featureId: String
)

FieldDescription
featureIdEchoes back the identifier of the feature that was launched.

Example Usage

val request = FeatureRequest.Builder()
    .requestId("REQ-${System.currentTimeMillis()}")
    .featureId("some-feature-id")
    .userCorrelationId("corr-5678")
    .token("host-app-token")
    .build()

sdk.getFeatureManager().launchFeature(
    activity = this,
    request = request,
    callback = object : FeatureCallback<LaunchResult> {
        override fun onComplete(result: LaunchResult, data: Map<String, Any?>) {
            Log.d(TAG, "Launched featureId: ${result.featureId}")
        }
        override fun onError(error: GoPayEnterpriseError) {
            Log.e(TAG, "${error.code}: ${error.message}")
        }
    }
)

Usage Notes

  • build() does not throw — validation is performed inside launchFeature(). Ensure featureId, userCorrelationId, requestId, and token are all non-blank before calling.
  • featureId must be whitelisted for your clientID; otherwise FeatureCallback.onError is invoked with GPE-2204.
  • Unlike verify(), launchFeature() does not take a CredentialReceiver — no auth-code exchange is performed.
  • Generate a fresh requestId for every launchFeature() call, the same as for verify().
  • The data parameter in onComplete may carry additional SDK metadata; it can safely be ignored if not needed.
  • Always call launchFeature() from the main thread.



Did this page help you?