perawallet / pera-wallet

Source code for Pera Wallet, simply the best Algorand wallet.
https://perawallet.app
Other
187 stars 60 forks source link

Wallet Connect v1 session not working on ios via deep link #86

Closed longda closed 2 years ago

longda commented 2 years ago

Hi!

I'm building an ios app from unity. It uses wallet connect to initiate a session with Pera Wallet via a deep link as outlined here: https://docs.walletconnect.com/mobile-linking#for-ios

When initiated, my app transitions to Pera Wallet but the "approve connection" modal never pops up in Pera Wallet. I've confirmed the configuration is correct by using a qr code (approve connection modal shows correctly, connection appears in Wallet Connect Sessions screen in settings) but my use case requires the deep link.

Just curious if this is a known issue and/or if there is a work around.

Thanks!

jasonboukheir commented 2 years ago

Wanted to chime in. The Deep link url that's being produced is like the following:

algorand-wc://wc?uri=wc:4015f93f-b88d-48fc-8bfe-8b063cc325b6@1?bridge=https%3A%2F%2F9.bridge.walletconnect.org&key=b0576e0880e17f8400bfff92d4caaf2158cccc0f493dcf455ba76d448c9b5655&algorand=true

To reproduce using Unity:

  1. Install latest version of Unity 2021.3 with iOS module.
  2. Follow instructions to install Unity Algorand SDK package.
  3. Open the Build Settings, change build target to iOS, and add the WalletConnectDemo.scene as the first scene. You will need to import the Wallet Connect sample if you installed the Unity SDK using the Package Manager.
  4. Setup your iOS build target and build for iOS. This should generate an xcode project.
  5. Open the xcode project from (4) and build/run to your ios device with Pera Wallet installed.
  6. Once the app is built and running, you should see a QrCode and a button that says "Connect With Wallet App". Press the button.
  7. Now press the "Connect to Pera Wallet" button.
  8. You should see the Pera Wallet app launch, but nothing else happens.
jasonboukheir commented 2 years ago

Found the issue!

The uri param was not URL Encoded 😵‍💫