alterando notificacao

This commit is contained in:
Ighor Moura 2025-07-23 18:18:18 -04:00
parent 79515f1205
commit d931dfeff9

View File

@ -53,23 +53,22 @@ class AditumSdkService(private val paymentApplication: PaymentApplication) {
private val _pinLengthFlow = MutableStateFlow(0)
val pinLengthFlow: StateFlow<Int> = _pinLengthFlow.asStateFlow()
fun register(listener: PaymentRegister) {
init {
coroutineScope.launch {
val callback = object : IPaymentCallback.Stub() {
paymentApplication.communicationService?.registerPaymentCallback(paymentCallback)
}
}
val paymentCallback = object : IPaymentCallback.Stub() {
override fun notification(
message: String?,
transactionStatus: TransactionStatus?,
command: AbecsCommands?
) {
Log.d(TAG, "\nnotification - ${ message ?: "" }")
Log.i(TAG, "\nnotification - ${ message ?: "" }")
if (message != null) {
_messageFlow.value = message.replace("\\s+".toRegex(), " ").trim()
}
listener.notification(
message?.replace("\\s+".toRegex(), " ")?.trim(),
transactionStatus,
command
)
}
override fun pinNotification(message: String?, length: Int) {
@ -95,10 +94,6 @@ class AditumSdkService(private val paymentApplication: PaymentApplication) {
}
}
paymentApplication.communicationService?.registerPaymentCallback(callback)
}
}
fun initAditumSdk(
applicationName: String,
applicationVersion: String,