Ionic Inappbrowser目标_blank在iOS中无法打开

时间:2018-04-05 08:06:39

标签: ionic3 cordova-plugins inappbrowser ionic-native

应用内浏览器var target =" _blank`"不在IOS上开放...它在Android上运行得很好。 我使用了Load start Event,加载Starts event只能工作target =" _blank"。

 let target = '_blank'
const browser = this.iab.create(this.url, target, this.options)
browser.on("loadstart")
   .subscribe(
      event => {
        console.log("loadstop -->",event);
        console.log(event.url)
         let browser_url = event.url;

         if(browser_url.indexOf("qwertyerror_message") > -1){
              let error_status = this.getParameterByName('qwertyerror_message',browser_url);
              console.log('status',status)
              browser.close();
              this.toast.create(error_status);
        }
        console.log('browser url',browser_url)

         if(browser_url.indexOf("qwertysupmob_status") > -1){
              this.pay_status = this.getParameterByName('qwertysupmob_status',browser_url);
              console.log('status',this.pay_status)
              if(status == "failure") {
                browser.close();
                this.navCtrl.push('PaymentStatusPage',{
                  payment_status: this.pay_status
                });
              }
         }
         if(browser_url.indexOf("qwertyorder") > -1){
            console.log('if qwertyorder');
            let order_id = this.getParameterByName('qwertyorder',browser_url);
            console.log('orderid',order_id);
            browser.close();
            this.navCtrl.push('PaymentStatusPage',{
              payment_status: this.pay_status,
              order_id: order_id,
            });
        }
      },
      err => {
        console.log("InAppBrowser loadstart Event Error: " + err);
   });

请提前帮助我。

1 个答案:

答案 0 :(得分:0)

只需在您的config.xml文件中添加<allow-navigation href="*" />