-
Notifications
You must be signed in to change notification settings - Fork 0
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
react native wallet POC #152
base: main
Are you sure you want to change the base?
Conversation
modules/react-native-wallet/android/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
modules/react-native-wallet/android/src/main/java/com/wallet/WalletModule.kt
Show resolved
Hide resolved
package com.wallet | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.Promise | ||
import com.facebook.react.bridge.ReadableMap | ||
|
||
abstract class WalletSpec internal constructor(context: ReactApplicationContext) : | ||
ReactContextBaseJavaModule(context) { | ||
|
||
abstract fun checkWalletAvailability(promise: Promise) | ||
abstract fun getSecureWalletInfo(promise: Promise) | ||
abstract fun getCardStatus(last4Digits: String, promise: Promise) | ||
abstract fun getCardTokenStatus(tsp: String, tokenRefId: String, promise: Promise) | ||
abstract fun addCardToWallet(cardData: ReadableMap, promise: Promise) | ||
} |
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.
This approach for compatibility with the old arch is fine, but you may also want to consider automatically copying the spec generated by codegen when there are any changes to the output. We already do it in other libraries: software-mansion/react-native-gesture-handler#3001.
This way you won't have to remember to update the paper spec each time you change the TS definition. You can also setup a github action to make sure every PR updates the java spec when needed.
modules/react-native-wallet/android/src/main/java/com/wallet/WalletPackage.kt
Outdated
Show resolved
Hide resolved
|
||
// Example method | ||
// See // https://reactnative.dev/docs/native-modules-ios | ||
RCT_EXPORT_METHOD(multiply:(double)a |
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.
Ah, yes. The best thing you can do with a wallet - multiply
😄
getPromiseOperation: (Promise) -> Unit | ||
): String = withContext(Dispatchers.IO) { | ||
suspendCancellableCoroutine { continuation -> | ||
val promise = object : Promise { |
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.
Are you passing this promise to the JS side?
I haven't used coroutines that much (and it was a while ago), but isn't there some way to handle this using Kotlin primitives instead of doing native-only promise (unless I missed something).
Explanation of Change
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop