Skip to content

How to connect UniSat Wallet from mobile web browser? #97

@JavierCervilla

Description

@JavierCervilla

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:

  1. ✅ UniSat app opens successfully
  2. ✅ User can see the connection request
  3. ✅ User approves the connection
  4. 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

  1. Deeplinks with returnUrl parameter

    unisat://request?method=connect&returnUrl=https://myapp.com/callback

    UniSat doesn't redirect to the provided URL

  2. Opening URL in UniSat's browser

    unisat://browser?url=https://myapp.com

    This 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.com
  • unisat://dapp?url=https://myapp.com
  • unisat://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=zzz

This 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.unisat becomes 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:

  1. Confirmation if any current solution exists that we might have missed
  2. Guidance on the recommended approach for web apps
  3. Information about future plans for mobile web support
  4. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions