Skip to content

🐛 Implement AppKitModalWalletListing.applicationId to correctly detect custom wallets on Android#334

Open
AlexV525 wants to merge 1 commit intoreown-com:developfrom
AlexV525:fix/custom-wallet-on-android
Open

🐛 Implement AppKitModalWalletListing.applicationId to correctly detect custom wallets on Android#334
AlexV525 wants to merge 1 commit intoreown-com:developfrom
AlexV525:fix/custom-wallet-on-android

Conversation

@AlexV525
Copy link
Contributor

Description

Adding AppKitModalWalletListing.applicationId and checking it first when using package:appcheck on Android.

Resolves #333

Copilot AI review requested due to automatic review settings January 27, 2026 14:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a bug where custom wallets could not be detected on Android devices. The issue was that the app installation check only used the URI (mobile link) to verify if a wallet was installed, but on Android, the package name (application ID) is required for proper detection.

Changes:

  • Added applicationId field to AppKitModalWalletListing model to support Android package name
  • Updated isInstalled method to accept and prioritize applicationId parameter for Android app checks
  • Modified Android app check logic to try applicationId first before falling back to URI-based checks

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.dart Added optional applicationId field to AppKitModalWalletListing model
packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.g.dart Generated JSON serialization code for new applicationId field
packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.freezed.dart Generated freezed code for new applicationId field including equality, hashCode, copyWith, and toString methods
packages/reown_appkit/lib/modal/services/uri_service/i_url_utils.dart Updated interface to include applicationId parameter in isInstalled method
packages/reown_appkit/lib/modal/services/uri_service/url_utils.dart Implemented Android-specific logic to check applicationId before URI for app installation detection
packages/reown_appkit/lib/modal/services/explorer_service/explorer_service.dart Passed applicationId from wallet listing to isInstalled call for custom wallets
Comments suppressed due to low confidence (1)

packages/reown_appkit/lib/modal/services/uri_service/url_utils.dart:132

  • The current implementation checks both isAppInstalled and isAppEnabled for both applicationId and uri. However, this could result in redundant checks when applicationId and uri are the same value (for example, when rdns is used as the uri for Android wallets). Consider checking if applicationId equals uri to avoid duplicate checks. This would improve performance and reduce unnecessary API calls to the AppCheck package.
  Future<bool> _androidAppCheck(String uri, String? applicationId) async {
    try {
      bool installed = false;
      if (applicationId != null && applicationId.isNotEmpty) {
        installed = await AppCheck().isAppInstalled(applicationId);
      }
      if (installed) {
        return true;
      }

      installed = await AppCheck().isAppInstalled(uri);
      if (installed) {
        return true;
      }

      bool enabled = false;
      if (applicationId != null && applicationId.isNotEmpty) {
        enabled = await AppCheck().isAppEnabled(applicationId);
      }
      if (enabled) {
        return true;
      }

      enabled = await AppCheck().isAppEnabled(uri);
      return enabled;
    } catch (e) {
      return false;
    }
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[appkit] Custom wallets is not available on Android due to the installed check will always failed without checking the package name

2 participants