Closed reyamir closed 4 months ago
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: https://github.com/getAlby/nostr-wallet-connect/pull/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)
Yes, I can listen event with tauri webview: https://tauri.app/v1/guides/features/events/ I will try https://github.com/getAlby/nostr-wallet-connect/pull/107 when it merged
@reyamir the change should be in NWC now. Could you try listening to the nwc:success
event?
yo, that great, I'll check it when working on lume v3
@reyamir I'll close this for now, please re-open if you still have any issues.
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 Taurinew Webview
https://tauri.app/v1/api/js/window/#webviewwindow to create a new webview window which open authorization urlbut 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?