Package-level declarations

Types

Link copied to clipboard
object Constants

Contains constant values used throughout the MTN MOMO SDK sample application.

Link copied to clipboard
class CredentialStorage(context: Context)

Secure credential storage backed by EncryptedSharedPreferences.

Link copied to clipboard

Production DispatcherProvider implementation that delegates to the real Dispatchers.

Link copied to clipboard

Abstraction over the standard CoroutineDispatcher set to allow dispatcher injection in tests.

Link copied to clipboard
data class SampleConfig(val apiVersionV1: String, val apiVersionV2: String, val environment: String, val providerCallbackHost: String, val apiUserId: String, val collectionPrimaryKey: String, val collectionSecondaryKey: String, val remittancePrimaryKey: String, val remittanceSecondaryKey: String, val disbursementsPrimaryKey: String, val disbursementsSecondaryKey: String, val callbackBaseUrl: String = "")

Runtime configuration values required by the sample app to initialise the MTN MOMO SDK.

Link copied to clipboard
data class SnackBarComponentConfiguration(val messageResId: Int = 0, val messageArgs: List<Any> = emptyList(), val actionLabel: String? = null, val duration: ERROR CLASS: Symbol not found for SnackbarDuration = SnackbarDuration.Short, val type: SnackBarType = SnackBarType.INFO)

Configuration data for displaying a Snackbar, encapsulating the message string resource, optional action label, display duration, and a semantic type that drives the snackbar color.

Link copied to clipboard
data class SnackBarThemeOptions(val messageTextColor: String = "#FFFFFF", val actionTextColor: String = "#FFCB05", val backgroundColor: String = "#004F71")

Theming options for a snackbar, specifying colors as hex strings for message text, action text, and background.

Link copied to clipboard

Semantic category of a snackbar message, used to pick its color: green for SUCCESS, red for ERROR, and the MTN blue brand color for neutral INFO messages.

Link copied to clipboard
object Utils

Utility object providing general-purpose helper functions for the sample app.

Functions

Link copied to clipboard

This is required to fix keyboard overlapping content in a Composable screen. This functionality is applied after the setContent function of the activity is called.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for NetworkResult<ERROR CLASS: Symbol not found for ResponseBody>.bodyText(): String?

Reads this result's ResponseBody as a UTF-8 string, or returns null when there is no body.

Link copied to clipboard
suspend fun ERROR CLASS: Symbol not found for SharedFlow<io/rekast/sdk/sample/utils/SnackBarComponentConfiguration>.hookSnackBar(scaffoldState: ERROR CLASS: Symbol not found for ScaffoldState, context: Context, onDisplay: (SnackBarComponentConfiguration) -> Unit = {}, action: () -> Unit = {})

Collects this SharedFlow and shows a Snackbar via scaffoldState for each emitted SnackBarComponentConfiguration that contains a non-empty message.

Link copied to clipboard

This function checks if the device is online

Link copied to clipboard

Returns this throwable's Throwable.message, or an empty string when it has none.

Link copied to clipboard
fun String?.parseColor(): ERROR CLASS: Symbol not found for androidx.compose.ui.graphics.Color

Parse this String to a color code to be used in compose. Color code must either a). begin with pound sign ('#') and should be of 6 valid characters or b). be equal to 'primaryColor', 'primaryVariantColor' or 'errorColor'

Link copied to clipboard
fun ERROR CLASS: Symbol not found for LiveData<kotlin/String>.valueOrEmpty(): String

Returns this LiveData's current value, or Constants.EMPTY_STRING when it has not been set.

Link copied to clipboard
fun ERROR CLASS: Symbol not found for LiveData<kotlin/String>.valueOrNullIfBlank(): String?

Returns this LiveData's current value, or null when it is unset or blank.