-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add React Native bridge method to query wallet availability #168
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -41,6 +41,15 @@ class SolanaMobileWalletAdapterModule(reactContext: ReactApplicationContext) : | |
return "SolanaMobileWalletAdapter" | ||
} | ||
|
||
@ReactMethod | ||
fun isWalletAvailable(promise: Promise) { | ||
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. I'm concerned that we haven't covered the case where:
If your dApp doesn't revalidate every time you foreground it, it will still claim that the wallet is not installed when in fact, it is. |
||
promise.resolve( | ||
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. Since |
||
LocalAssociationIntentCreator.isWalletEndpointAvailable( | ||
reactApplicationContext.packageManager | ||
) | ||
) | ||
} | ||
|
||
@ReactMethod | ||
fun startSession(config: ReadableMap?, promise: Promise) = launch { | ||
mutex.lock() | ||
|
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 hasn't been published yet; to verify that this code compiled, I published to my local Maven repo
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.
Oooh can you lazytwitter me and share how to do that?