Skip to content

Commit

Permalink
docs: add warning around androidScheme with Android webview 117 (#7098)
Browse files Browse the repository at this point in the history
Co-authored-by: Dallas James <dallastjames@gmail.com>
  • Loading branch information
jcesarmobile and dallastjames authored Nov 28, 2023
1 parent 8d97b80 commit 13935f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ private boolean validateScheme(String scheme) {
return false;
}

// Non-http(s) schemes are not allowed to modify the URL path as of Android Webview 117
if (!scheme.equals("http") && !scheme.equals("https")) {
Logger.warn(
"Using a non-standard scheme: " + scheme + " for Android. This is known to cause issues as of Android Webview 117."
);
}

return true;
}

Expand Down
5 changes: 5 additions & 0 deletions cli/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ export interface CapacitorConfig {
/**
* Configure the local scheme on Android.
*
* Custom schemes on Android are unable to change the URL path as of Webview 117. Changing this value from anything other than `http` or `https` can result in your
* application unable to resolve routing. If you must change this for some reason, consider using a hash-based url strategy, but there are no guarentees that this
* will continue to work long term as allowing non-standard schemes to modify query parameters and url fragments is only allowed for compatibility reasons.
* https://ionic.io/blog/capacitor-android-customscheme-issue-with-chrome-117
*
* @since 1.2.0
* @default http
*/
Expand Down

0 comments on commit 13935f0

Please sign in to comment.