Ionic: Opening html content in Inapp Browser

2019-05-25 08:46发布

I'm trying to integrate payment gateway in an Ionic mobile app. I get the HTML code from the server which contains a form with all the post parameters and submit on page load to call the payment gateway.

  1. How can I open the in-app browser with the HTML content?

  2. After the transaction, the payment gateway will call the server URL & process the response. How can I now communicate back to Ionic app to close In-app browser & show the response?

1条回答
爷、活的狠高调
2楼-- · 2019-05-25 09:41

Check out the exceuteScript Api of the Cordova In-App-Browser plugin. You should be able to

  1. Add the required HTML to an empty document
  2. Poll the document location for completion of the payment flow

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/#inappbrowserexecutescript

查看更多
登录 后发表回答