WalletConnectSharp icon indicating copy to clipboard operation
WalletConnectSharp copied to clipboard

Mobile Support

Open davidchavezgrant opened this issue 1 year ago • 1 comments

I've recently been experimenting with this on mobile platforms. Namely, MAUI and Avalonia on iOS. I've successfully been able to send a wallet connection request to a wallet, but very often, the connection will fail or the target wallet won't redirect back to my application. Trust Wallet also gives me an error like WalletConnect Session was disconnected. Go back to your browser and try WalletConnect again

For reference, I've written something like this in an AvaloniaUI app, and did something similar for MAUI:

    private async Task<SessionStruct?> OpenWallet(ConnectedData connection, bool useRainbow)
    {
        string schema = "https://";

        if (useRainbow)
        {
            schema += "rnbwapp.com";
        }
        else
        {
            schema += "link.trustwallet.com";
        }

        var urlString = schema + "/wc?uri=" + connection.Uri;
        var nsUrl     = new NSUrl(urlString);
        await UIApplication.SharedApplication.OpenUrlAsync(nsUrl, new UIApplicationOpenUrlOptions());
        return await connection.Approval;
    }

Interestingly, using the web3modal javascript package within a Blazor Web View does work as expected (most of the time). I'm trying to work toward a solution that doesn't rely on a webview, though.

Has anyone else done work on this or have any ideas?

davidchavezgrant avatar May 05 '23 00:05 davidchavezgrant

this is related to deep linking to a wallet which this library doesn't currently support, but we plan on adding support (unity already has this)

gigajuwels avatar Sep 26 '23 19:09 gigajuwels