Search code examples
formsionic-frameworkionic3ionic4

Ionic form action to redirect to internal application page


How would you redirect an "action" property on a form to another page in the ionic application?

Background: I'm using peach payments payment widget, and once the payment is done, it redirects you to any http or https site. Now for web, that's fine, but for ionic, that's obviously not that great.

Is there some internal http/s url Ionic uses to serve on the users phone for me to redirect to (don't think so), or is there some other way I haven't even thought about to redirect to another page in the users application?

  <form action="https://some-dumb-external-site-i-dont-want" class="paymentWidgets" data-brands="VISA MASTER AMEX"></form>

Edit: Using http://localhost:8080/xxxx, only works on Android and not IOS


Solution

  • You might want to do the whole thing in an In-App Browser and let Peach Payments handle all the redirects there. Obviously, this isn't the best UX, but for hybrid it might be good enough.

    There seems to be a way to do it using an iframe but this looks rather hacky and, perhaps, brittle and unmaintainable.