-
Notifications
You must be signed in to change notification settings - Fork 25
Description
How to connect UniSat Wallet from mobile web browser?
Problem Description
I'm building a web application (dApp) that needs to support UniSat Wallet connections from mobile devices. Here are the current scenarios:
- ✅ Desktop browser with UniSat extension installed - works perfectly via
window.unisat - ❌ Mobile browser (Safari, Chrome, etc.) - no working solution, deeplinks cannot return data to web apps
- ❌ UniSat's internal browser - cannot navigate to custom URLs, only pre-configured dApps are accessible
What We Need
A way for users to connect their UniSat Wallet when accessing our web app from a mobile browser.
Current Situation with Mobile
Following the deeplink documentation, I implemented:
const deeplinkUrl = `unisat://request?method=connect&from=AppName&nonce=${nonce}`;
window.location.href = deeplinkUrl;What happens:
- ✅ UniSat app opens successfully
- ✅ User can see the connection request
- ✅ User approves the connection
- ❌ Response never reaches the web app
Why it doesn't work:
According to the documentation, UniSat responds with:
unisat://response?data=xxxxx&nonce=xxxxx
Web browsers cannot intercept custom URL schemes like unisat://response. This only works for native mobile apps that can register custom URL scheme handlers.
What We've Tried
-
❌ Deeplinks with returnUrl parameter
unisat://request?method=connect&returnUrl=https://myapp.com/callbackUniSat doesn't redirect to the provided URL
-
❌ Opening URL in UniSat's browser
unisat://browser?url=https://myapp.comThis deeplink format doesn't work
Questions
1. Does UniSat support opening external URLs in its internal browser?
Is there any deeplink format that would open our web app inside UniSat's internal browser? For example:
unisat://browser?url=https://myapp.comunisat://dapp?url=https://myapp.comunisat://open?url=https://myapp.com- Any other format?
This would be ideal because then window.unisat would be available to our web app.
2. Can UniSat redirect back to the web app with connection data?
Instead of responding with unisat://response, could UniSat redirect to an HTTP/HTTPS URL with the data?
Example:
// Request
unisat://request?method=connect&from=DexPad&nonce=xxx&callback=https://myapp.com/auth
// Response after approval
// UniSat opens: https://myapp.com/auth?nonce=xxx&data=yyy&signature=zzzThis would allow web apps to receive the connection data.
3. What is the official recommendation for web apps?
- Is there a WalletConnect integration for UniSat?
- Are there Universal Links that could work?
- Is mobile web support planned for the future?
Impact
This limitation means:
- Web applications cannot support UniSat on mobile
- Users must use desktop to connect with UniSat
- Poor UX compared to competitors
Other Bitcoin Wallets That Support Mobile Web:
- Xverse Wallet: WalletConnect support for mobile browsers
- Leather Wallet: Mobile web integration with proper callbacks
- OKX Wallet: Deeplink integration that works with web apps and navigation to custom urls in the browser
All these wallets provide seamless mobile web experience, which UniSat currently lacks.
Proposed Solutions
Option A: Internal Browser Deeplink (Preferred)
unisat://browser?url=https://myapp.com
- Opens our app in UniSat's internal browser
window.unisatbecomes available- Users can connect directly
- Best UX
Option B: HTTP Callback
unisat://request?method=connect&callback=https://myapp.com/callback&nonce=xxx
// After approval, UniSat opens: https://myapp.com/callback?nonce=xxx&data=yyy
- Redirects back to web app with data
- Works with any mobile browser
- Standard OAuth-like flow
Option C: WalletConnect
// Use WalletConnect protocol
const connector = new WalletConnect({...});
- Industry standard for mobile wallet connections
- Works universally across platforms
- Requires QR code or deep linking
Option D: Universal Links
https://unisat.io/connect?dapp=https://myapp.com&method=connect
- Opens app if installed, web fallback
- More reliable than custom URL schemes
- Better iOS support
Environment
- Platform: Mobile web (iOS Safari, Android Chrome)
- UniSat Version: Latest mobile app
- Use Case: Progressive Web App / Mobile-responsive website
- Current Status: No working solution exists
Request
We would greatly appreciate:
- Confirmation if any current solution exists that we might have missed
- Guidance on the recommended approach for web apps
- Information about future plans for mobile web support
- Documentation updates if a solution is available
Thank you for your help! UniSat is a great wallet and we really want to support it on mobile.
Related Documentation: