🐛 Implement AppKitModalWalletListing.applicationId to correctly detect custom wallets on Android#334
Open
AlexV525 wants to merge 1 commit intoreown-com:developfrom
Open
Conversation
…ect custom wallets on Android
Contributor
There was a problem hiding this comment.
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
applicationIdfield toAppKitModalWalletListingmodel to support Android package name - Updated
isInstalledmethod to accept and prioritizeapplicationIdparameter for Android app checks - Modified Android app check logic to try
applicationIdfirst 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
isAppInstalledandisAppEnabledfor bothapplicationIdanduri. However, this could result in redundant checks whenapplicationIdanduriare the same value (for example, whenrdnsis used as the uri for Android wallets). Consider checking ifapplicationIdequalsurito 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adding
AppKitModalWalletListing.applicationIdand checking it first when usingpackage:appcheckon Android.Resolves #333