[英]Capacitive Ionic WebView is showing blank page after build on iOS
我正在使用离子电容器。 构建后,iOS 中的 webview 没有打开任何外部链接。 xcode 调试没有错误或警告消息。 但是,它在浏览器和 android 上运行良好。 我错过了什么?
在 index.html 中
<meta http-equiv="Content-Security-Policy"
content="gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';">
网络视图配置:
import { InAppBrowser } from '@ionic-native/in-app-browser';
var browser = InAppBrowser.create( wpcUrl, "_blank",
{
location: 'no', //Or 'no'
hardwareback: 'yes',
mediaPlaybackRequiresUserAction: 'yes',
closebuttoncaption: 'Share', //iOS only
disallowoverscroll: 'no', //iOS only
toolbar: 'yes', //iOS only
toolbarposition: 'bottom',
enableViewportScale: 'no', //iOS only
allowInlineMediaPlayback: 'no', //iOS only
presentationstyle: 'formsheet', //iOS only
}
);
我也尝试了 target _blank 和 _system 以及 _self,但同样的问题。
注意:我的根目录下没有任何 config.xml 文件。 我所有的 manifest.json 看起来像这样:
{
"short_name": "WPCafe App",
"name": "My WPCafe App",
"icons": [
{
"src": "assets/icon/favicon.png",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "assets/icon/icon.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#ffffff",
"background_color": "#ffffff"
}
是网址问题。 您可以使用 encodeURI 方法对 URL 进行编码:
let url = encodeURI(YOUR_URL);
let browser = InAppBrowser.create(url, '_blank', InAppBrowserOptions);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.