feat: implement Android App Links and initialize core frontend routin…#95
Open
zinodict121 wants to merge 1 commit into
Open
feat: implement Android App Links and initialize core frontend routin…#95zinodict121 wants to merge 1 commit into
zinodict121 wants to merge 1 commit into
Conversation
…g and native project configuration
|
@zinodict121 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #77
📱 Feature: Android App Links implementation for
claim_url📝 Description
This PR implements native Android App Links to automatically intercept and route MicoPay claim URLs (e.g.,
https://app.micopay.xyz/claim/mcr-abc). When an agent sends a claim link via SMS or WhatsApp, tapping it will now open the MicoPay app directly to theClaimQRscreen without prompting a browser disambiguation dialog.🛠️ Technical Implementation
Android Manifest (
AndroidManifest.xml):<intent-filter>withandroid:autoVerify="true"for thehttpsscheme, hostapp.micopay.xyz, and path prefix/claim/.launchMode="singleTask"to ensure backgrounded instances receive new intents gracefully viaonNewIntent.Backend Asset Links (
assetlinks.json&index.ts):.well-known/assetlinks.jsonfile pointing tocom.micopay.app.@fastify/static(v7 to maintain compatibility with Fastify v4) to serve thepublic/directory./.well-known/assetlinks.jsonto ensure a direct HTTP200 OK(Android's verifier will fail if redirects occur) alongside correctCache-ControlandContent-Typeheaders.React App Capacitor Routing (
App.tsx):AppUrlOpenListenercomponent mounted inside<HashRouter>./claim/mcr-abc), the listener pulls thepathnameand passes it directly touseNavigate(pathname), whichHashRouternatively translates to#/claim/mcr-abc.Capacitor.isNativePlatform()to ensure the web builds (npm run dev) remain entirely unaffected.ClaimQRRouteand hid the BottomNav for all/claim/views.sha256_cert_fingerprintsfield inmicopay/backend/public/.well-known/assetlinks.jsoncurrently contains a"TODO"placeholder.🧪 Testing Steps
npm installinsidemicopay/backendandmicopay/frontend.cd micopay/frontend && npx cap sync android.npm run devinbackend) to host the assetlinks endpoint.adb shell am start -W -a android.intent.action.VIEW -d "https://app.micopay.xyz/claim/mcr-test-123" com.micopay.appExpected result: The existing app session is brought to the foreground and reroutes to the new claim URL immediately.