RootSoft / walletconnect-dart-sdk

Open protocol for connecting dApps to mobile wallets with QR code scanning or deep linking.
MIT License
102 stars 61 forks source link

Connect Wallet by DeepLinking #21

Closed DedicatedDev closed 2 years ago

DedicatedDev commented 2 years ago

I'm trying to connect by deep linking. QR code sample was really but did not find how can I implement deeplinking. Is there any idea?

RootSoft commented 2 years ago

I'm using the following code to sign transactions using the Algorand Wallet from a deep link. I'm launching a URI using url_launcher

  /// Launch the Algorand Wallet and requests to sign the transaction.
  Future<List<Uint8List>> signTransaction(
    List<RawTransaction> transactions, {
    int delay = 4,
  }) async {
    final session = _connector.session;
    final uri =
        '${session.protocol}:${session.handshakeTopic}@${session.version}';

    final launched = await launch(uri);
    if (!launched) {
      throw WalletConnectException(
          'Do you have the Algorand Wallet installed?');
    }

    // Wait x seconds
    await Future.delayed(Duration(seconds: delay));

    // Sign the transaction
    return await _connector
        .signTransactions(transactions.map((tx) => tx.toBytes()).toList());
  }
DedicatedDev commented 2 years ago

I have no issue with sign. current my problem is just when I try to open uri, it is opening rainbow wallet always.

RootSoft commented 2 years ago

Closing as discussed in the Algorand Discord channel.

DedicatedDev commented 2 years ago

so solved issue in iOS and recover session problem?