Skip to content

Wallet connection flow creates issue #249

@umaid56

Description

@umaid56

When connecting a wallet through ReownAppKitModal, the wallet bottom sheet opens and shows the list of wallets correctly.
However, when a wallet is selected, The wallet opens and shows the connect wallet popup. After clicking Connect, instead of returning to my app instance, one of two things happens:

  1. If a universal link is configured, the wallet redirects to that website.
  2. If no universal link is set, my app is opened but as a new instance.

When I manually open my app again, the wallet is connected successfully.

So the deep link works in terms of connecting the wallet, but the redirection does not return properly to the existing app instance.
Can you please let me know the issue

AppKitService

class AppKitService {
  static late ReownAppKitModal _appKitModal;

  static Future<void> initializeWithContext(BuildContext context) async {
    _appKitModal = ReownAppKitModal(
      context: context,
      projectId: 'xxx',
      metadata: const PairingMetadata(
        name: 'Outlast',
        description: 'Outlast App',
        url: 'https://example.com',
        icons: ['https://example.com/icon.png'],
        redirect: Redirect(
          native: 'outlast://',
          universal: 'https://outlast.app',
          linkMode: true,
        ),
      ),
    );

    await _appKitModal.init();
    DeepLinkHandler.init(_appKitModal);
  }

  static ReownAppKitModal get appKitModal => _appKitModal;
}

DeepLinkHandler

class DeepLinkHandler {
  static const _eventChannel = EventChannel('com.outlast.app/events');
  static late IReownAppKitModal _appKitModal;

  static void init(IReownAppKitModal appKitModal) {
    _appKitModal = appKitModal;
    _eventChannel.receiveBroadcastStream().listen(onLink, onError: _onError);
  }

  static void onLink(dynamic link) async {
    if (link.toString().startsWith('outlast://') ||
        link.toString().startsWith('https://outlast.app')) {
      final uri = Uri.parse(link.toString());
      await _appKitModal.dispatchEnvelope(link);
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    appkitAppKit related issueawaiting customerFurther information has been requestedhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions