Skip to content
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

Issue when use with Tauri app #90

Closed
reyamir opened this issue Sep 19, 2023 · 5 comments
Closed

Issue when use with Tauri app #90

reyamir opened this issue Sep 19, 2023 · 5 comments

Comments

@reyamir
Copy link

reyamir commented Sep 19, 2023

Hi, I'm from Lume (https://github.com/luminous-devs/lume)

I've added support NWC via Alby on Lume, but I've use a tricky way, because window.open is not work in Tauri. I've fixed it by using Tauri new Webview https://tauri.app/v1/api/js/window/#webviewwindow to create a new webview window which open authorization url

but it come up with other issue, I can't listen user event, so I don't know user is confirm authorized or not. In Lume, I temporary make it work by assume user alway click confirm button https://github.com/luminous-devs/lume/blob/main/src/app/nwc/components/alby.tsx

I wonder is there other way to make Alby work well with Tauri?

@bumi
Copy link
Contributor

bumi commented Sep 19, 2023

Hey, thanks for the issue! that's a good and important one.
NWC should be easily usable from any environment and not depend on the browser. You use the getAuthorizationUrl exactly as intended.
Sadly there is no standardized way for NWC apps to report back the status except a link to a "nostr+walletconnect" URL which requires custom protocol handlers and has problems in various cases like for example mobile apps where multiple apps could register that protocol handler.

Anyway, we have on open PR that actually fires an event: getAlby/nostr-wallet-connect#107
And if I understand the tauri webview correctly then you should be able to listen to that event.
No you think this would work?

Currently it only fires a nwc:success event which does not contain any information (you have all information anyway already) but theoretically the event could also contain nwc connection information (this needs some security review though)

@reyamir
Copy link
Author

reyamir commented Sep 20, 2023

Yes, I can listen event with tauri webview: https://tauri.app/v1/guides/features/events/
I will try getAlby/nostr-wallet-connect#107 when it merged

@rolznz
Copy link
Contributor

rolznz commented Dec 14, 2023

@reyamir the change should be in NWC now. Could you try listening to the nwc:success event?

@reyamir
Copy link
Author

reyamir commented Dec 14, 2023

yo, that great, I'll check it when working on lume v3

@rolznz
Copy link
Contributor

rolznz commented Jun 3, 2024

@reyamir I'll close this for now, please re-open if you still have any issues.

@rolznz rolznz closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants