【发布时间】:2018-12-04 02:19:35
【问题描述】:
我使用 Ionic 3。此代码适用于其他网站,但对于 Google Play 的 url,它不起作用。如何使用 WebView 加载 Google Play 页面?
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { InAppBrowser, InAppBrowserOptions } from '@ionic-native/in-app-browser';
declare var navigator: any;
declare var Connection: any;
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
Connection: any;
isLaunch: Boolean = false;
constructor( private platform: Platform, private iab: InAppBrowser) {
this.platform.ready().then(() => {
this.launch();
});
}
launch() {
this.isLaunch = true;
const browser = this.iab.create('https://play.google.com','_self' , "location=yes");
browser.show();
}
}
<ion-content>
<iframe width='100%' height='100%'
src="https://play.google.com/" frameborder="0" allowfullscreen>
</iframe>
</ion-content>
提前谢谢你。
【问题讨论】:
-
您要加载应用安装页面吗?还是主站点?
-
你似乎也在同时尝试 iframe 和 inAppBrowser...
-
我要显示一个音乐专辑页面,例如:[link] (play.google.com/store/music/album/…)
标签: html typescript ionic-framework webview google-play