-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(ios+android): Add possibility to configure loading scheme #1810
feat(ios+android): Add possibility to configure loading scheme #1810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Can you rename the config name to iosScheme
? Because it should be configurable for Android too and they can't have the same name. (Not sure if you also want to try to do the Android part in this PR)
Also, don't use the getSchemeForConfig
, just read the value once and put it into a regular variable in CAPBridge, and in CAPAssetHandler change the setConfig
to a setScheme
that sets an internal scheme variable.
Finally, after reading the value but before setting it, make sure it's allowed, there is a function to check if a scheme value can be used or not, and in case it's not, default to capacitor too.
Thank you for your feedback. I will apply it this week, and will add the functionality for Android as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a minor change on Android and simplified the iOS code as it was crashing and I realized we didn't really need the scheme on the CAPAssetHandler.
Thanks for the PR, will merge once tests finish.
Fixes #1736. Because Capacitor uses a different origin on iOS for serving content, it means that certain data might get lost when migrating from Cordova to Capacitor (like local storage for example).
This PR adds functionality to specify the scheme in the config.