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: Setting iosScheme to http has no effect #2173

Closed
1 of 4 tasks
malua opened this issue Nov 13, 2019 · 13 comments
Closed
1 of 4 tasks

bug: Setting iosScheme to http has no effect #2173

malua opened this issue Nov 13, 2019 · 13 comments

Comments

@malua
Copy link

malua commented Nov 13, 2019

Bug Report

Capacitor Version

@capacitor/cli 1.3.0
@capacitor/ios 1.3.0
@capacitor/android 1.3.0
@capacitor/core 1.3.0

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

Setting iosScheme in capacitor.config.json to http makes no difference. App is still being loaded from capacitor://
I already removed the ios platform completely and an re-added it, but that didn't work unfortunatley. Am I missing something? Do I need to set something in the plist file or anywhere else?

Expected Behavior

Setting iosScheme in capacitor.config.json to http should make capacitor load the app from http:// instead of capacitor://

npm --version output:
6.9.0
node --version output:
v12.13.0
pod --version output (iOS issues only):
1.7.5

Thank you for your help and awesome products!

@malua
Copy link
Author

malua commented Nov 14, 2019

oh, it's just working with custom protocols right? do you happen to know if ionic://localhost or capacitor://localhost are considered safe for something like stripe.js?

@jcesarmobile
Copy link
Member

WKWebView doesn't allow to use http or http for serving local assets, this works as expected.

Not sure about stripe, sorry.

@kedarguy
Copy link

kedarguy commented Jun 2, 2020

oh, it's just working with custom protocols right? do you happen to know if ionic://localhost or capacitor://localhost are considered safe for something like stripe.js?

Hey, I am also looking in to this for Stripe.js, did you find a way to integrate Stripe with capacitor ios and android apps?

@malua
Copy link
Author

malua commented Jun 5, 2020

we are still using cordova with cordova-plugin-ionic-webview@2.5.3
i dont think its possible to get Stripe.js working with custom protocols.

your best bet is to work with a plugin like this one and use the native stripe sdk
https://github.com/zyra/capacitor-stripe

@joseph-navant
Copy link

WKWebView doesn't allow to use http or http for serving local assets, this works as expected.

Not sure about stripe, sorry.

Hi @jcesarmobile! Could you explain why WKWebView doesn't allow to use http or https for serving local assets? I would like to know more about this but I don't know what/how to search it.

Thanks in advance

@malua
Copy link
Author

malua commented Jun 26, 2020

as far as i can tell, stripe.js now also sees file:// and ionic:// as safe origins!
in the stripe js file you can find this function:
key: "_ensureHTTPS", value: function () { var e = window.location.protocol, t = -1 !== ["https:", "file:", "ionic:"].indexOf(e),

I also test it right now, and it works if you serve your app from ionic:// on ios!

@mikeyyyzhao
Copy link

is there anyway to set the scheme to http? Google still does not recognize capacitor:// or ionic:// as safe origins in Authorized JavaScript origins for their auth unfortunately

@madmacc
Copy link

madmacc commented May 9, 2021

So @malua says that ionic:// works and @mikeyyyzhao says that it does not.
@malua Can you confirm it works?

I can see it in the code here if you search for the word ionic: https://js.stripe.com/v3/
["https:","file:","ionic:","httpsionic:","chrome-extension:","moz-extension:"]
Is there anywhere to view the code without it minimized?
I am just researching at this stage so can't test.

@malua
Copy link
Author

malua commented May 10, 2021

I was talking about Stripe working, not about Google as mikeyyyzhao was.
I can definity confirm that stripe works on ionic://.

I have the ios on ionic:// and the android app on https://

@madmacc
Copy link

madmacc commented May 10, 2021

@malua thanks for responding.
Apple Pay too? or just the other stripe functions?

https://stripe.com/docs/stripe-js/elements/payment-request-button#html-js-prerequisites

@malua
Copy link
Author

malua commented May 12, 2021

i have not tried that, but I guess you would not work. rather you would have to use this plugin https://github.com/capacitor-community/stripe and handle the payment in the native part

@madmacc
Copy link

madmacc commented May 12, 2021

Yeah it looks like it won't work with Ionic.
I got that capacitor plugin working today and it works.

The main issue is that you need to register a merchant id for the plugin (native) but not for the web version. I would prefer not to register a merchant id for every stripe connected account I am paying to. Having to set up a merchant id means I would have to release a new version of the app every time a customer joined my platform which is not feasible.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

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 Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants