Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Custom URL schemes are not intercepted on Android (capacitor v6) #7630

Closed
1 of 3 tasks
AlexandrosGounis opened this issue Aug 23, 2024 · 3 comments
Closed
1 of 3 tasks
Labels
needs reproduction needs reproducible example to illustrate the issue

Comments

@AlexandrosGounis
Copy link

Capacitor Version

6.1.2

Other API Details

npm -v output: 10.2.3
node -v output: v20.10.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

We want to support both Android App Links ("https" scheme) and custom urls for deep linking. The "https" works as expected but the custom url scheme is not intercepted on Android. We have included a custom scheme in strings.xml as follows:

<string name="custom_url_scheme">myapp</string>

And in AndroidManifest.xml:

<data android:scheme="@string/custom_url_scheme" />

we have also tried:

<data android:scheme="myapp" />

However, when we redirect to myapp://foo from another Android app or webpage, we are not redirected to the capacitor App

Expected Behavior

Both App Links and custom urls should work, like in v5.

Project Reproduction

(private repository)

Additional Information

No response

@jcesarmobile jcesarmobile added the needs reproduction needs reproducible example to illustrate the issue label Aug 23, 2024
Copy link

ionitron-bot bot commented Aug 23, 2024

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.
Please see the Contributing Guide for how to create a Sample App.
Thanks! Ionitron 💙

@ionitron-bot ionitron-bot bot removed the triage label Aug 23, 2024
@Ionitron Ionitron added needs reply needs reply from the user and removed needs reply needs reply from the user labels Aug 23, 2024
@jcesarmobile jcesarmobile added the needs reply needs reply from the user label Aug 23, 2024
@AlexandrosGounis
Copy link
Author

We found out what was causing this issue and we think it is important to point that out in the docs.
When both Universal Links and custom URL schemes are defined, they need to be in separate <intent-filters>. This is because capacitor by default includes an android:autoVerify="true" in its main intent-filter, and custom schemes will not be intercepted unless they are defined in a separate <intent-filter>, without autoVerify.
We believe this is a nuance worth mentioning in the docs.

@Ionitron Ionitron removed the needs reply needs reply from the user label Aug 26, 2024
@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Copy link

ionitron-bot bot commented Sep 26, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction needs reproducible example to illustrate the issue
Projects
None yet
Development

No branches or pull requests

3 participants