我需要将一些数据(登录名和密码)传递到我使用 inAppBrowser 打开的某个网站。
我之前将数据保存到 IOS - keychain 中。
当我通过按钮打开 inAppBrowser 时,显示的第一页是此登录页面。在 2 个字段中,我想从钥匙串(keychain)中插入数据。
这有可能吗?如果是,我该怎么办?
我正在使用 ionic v2。
提前致谢
附言 我想我看到了适用于 ionic v1 的东西,但没有看到适用于 v2 的东西。
最佳答案
您可以只使用 InAppBrowser
发送带有参数的 url 作为您的 url 查询
import { InAppBrowser } from '@ionic-native/in-app-browser';
username:string;
password:string;
var openBrowser(url){
let browser = new InAppBrowser('url', '_self'); //change it to _system if you want to open in System Browser
}
this.openBrowser('http://yourwebsite.com/api/action?username='+this.username+'&password='+this.password);
然后在您的网站中,您只需从查询中获取值并将这些值填入您的用户名和密码输入字段。
关于android - 将数据从我的混合 Ionic 2 应用程序传递到 inAppBrowser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45861532/