Ionic:在Inapp Browser中打开html内容 [英] Ionic: Opening html content in Inapp Browser

查看:349
本文介绍了Ionic:在Inapp Browser中打开html内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将支付网关集成到Ionic移动应用中。我从服务器获取HTML代码,其中包含一个包含所有发布参数的表单,并在页面加载时提交以调用支付网关。

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. 如何使用HTML内容打开应用内浏览器?

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

交易完成后,支付网关将调用服务器URL&处理响应。我现在如何与Ionic应用程序进行通信以关闭应用内浏览器&显示回复?

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?


推荐答案

查看 exceuteScript Cordova In-App-Browser插件的Api。您应该能够

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


  1. 将所需的HTML添加到空文档中

  2. 轮询文档位置完成付款流程

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

这篇关于Ionic:在Inapp Browser中打开html内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆