alterando notificacao
This commit is contained in:
parent
79515f1205
commit
d931dfeff9
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user