-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #34
Changes from all commits
97d050d
d65292e
47c89b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,11 @@ object WalletIntentProcessor { | |
| val intentAction = intent.action | ||
| val packageName = intent.`package` | ||
| val callingPackage = activity.callingPackage | ||
| val extraText = intent.getStringExtra(Intent.EXTRA_TEXT) | ||
|
|
||
| WalletLogger.d(TAG, "🔍 [CENTRAL] Processando intent - Action: $intentAction, Package: $packageName, CallingPackage: $callingPackage") | ||
| WalletLogger.d(TAG, "🔍 [CENTRAL] EXTRA_TEXT: ${if (extraText.isNullOrEmpty()) "vazio/null" else "${extraText.length} caracteres - ${extraText.take(100)}${if (extraText.length > 100) "..." else ""}"}") | ||
| WalletLogger.d(TAG, "🔍 [CENTRAL] Extras: ${intent.extras}") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fazer o log do objeto |
||
|
|
||
| // Verificar se há extras na intent (usando safe call operator, mais idiomático em Kotlin) | ||
| val hasExtras = intent.extras?.isEmpty() == false | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.Arguments | |
| import com.facebook.react.bridge.Callback | ||
| import com.facebook.react.bridge.Promise | ||
| import com.facebook.react.bridge.ReactApplicationContext | ||
| import com.facebook.react.bridge.WritableArray | ||
| import com.facebook.react.bridge.WritableMap | ||
| import com.builders.wallet.samsungpay.util.PartnerInfoHolder | ||
| import com.builders.wallet.samsungpay.util.ErrorCode | ||
|
|
@@ -185,8 +186,14 @@ class SamsungWalletImplementation(private val reactContext: ReactApplicationCont | |
| val listener = object : GetCardListener { | ||
| override fun onSuccess(cardList: List<Card>) { | ||
| WalletLogger.d(TAG, "onSuccess callback is called, list.size= ${cardList.size}") | ||
| val result = cardList.map { it.toSerializable() } | ||
| WalletLogger.i(TAG, "- cards - $result") | ||
|
|
||
| // Converter lista de WritableMap para WritableArray (React Native requer WritableArray para arrays) | ||
| val result: WritableArray = Arguments.createArray() | ||
| cardList.forEach { card -> | ||
| result.pushMap(card.toSerializable()) | ||
| } | ||
|
Comment on lines
+191
to
+194
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| WalletLogger.i(TAG, "- cards - ${cardList.size} cards retornados") | ||
| promise.resolve(result) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A expressão para formatar a mensagem de log é um pouco complexa. Usar o safe call operator (
?.let) com o elvis operator (?:) pode tornar o código mais idiomático e um pouco mais legível, evitando oif/elseaninhado dentro da string template.