React Native' WebView'不在生产构建中加载脚本-IOS
我的html文件带有脚本,我需要在react react
屏幕中显示它,因此我使用了react-native-native-webview
,它在ios debug构建但在
ios
生产构建中不起作用,
这是我的html页面,
<html >
<meta name="viewport" content="width=device-width, initial-scale=1" />
<body onload="loader();">
<script>
window.fwSettings = {
'widget_id': 7300********
};
!function () {
if ("function" != typeof window.FreshworksWidget)
{
var n = function () {
n.q.push(arguments)
};
n.q = [],
window.FreshworksWidget = n } }()
</script>
<script type='text/javascript'
src='https://widget.freshworks.com/widgets/7*********.js' async defer></script>
<script>
function loader() {
FreshworksWidget('hide', 'launcher');
FreshworksWidget('open');
};
</script>
</body>
</html>
我将此HTML页面放置在webview
<WebView
source={kbHTML}
javaScriptEnabled={true}
domStorageEnabled={true}
originWhitelist={['*']}
scalesPageToFit={false}
startInLoadingState={true}
automaticallyAdjustContentInsets={false}
containerStyle={{
flex: 1,
width: '100%',
height: '100%'
}}
style={{
flex: 1,
height: height,
width: width,
resizeMode: 'cover',
}}
/>
之类调试模式,但在ios
生产构建中不起作用。
react-native-webview:“^11.18.1”, 反应:“ 0.64.2”
I have html file with scripts, I need to display it in React native
screen so I used react-native-webview
, it is working fine in ios
debug build but not working in ios
production build getting blank screen
This is my html page
<html >
<meta name="viewport" content="width=device-width, initial-scale=1" />
<body onload="loader();">
<script>
window.fwSettings = {
'widget_id': 7300********
};
!function () {
if ("function" != typeof window.FreshworksWidget)
{
var n = function () {
n.q.push(arguments)
};
n.q = [],
window.FreshworksWidget = n } }()
</script>
<script type='text/javascript'
src='https://widget.freshworks.com/widgets/7*********.js' async defer></script>
<script>
function loader() {
FreshworksWidget('hide', 'launcher');
FreshworksWidget('open');
};
</script>
</body>
</html>
I placed this html page in Webview
like this
<WebView
source={kbHTML}
javaScriptEnabled={true}
domStorageEnabled={true}
originWhitelist={['*']}
scalesPageToFit={false}
startInLoadingState={true}
automaticallyAdjustContentInsets={false}
containerStyle={{
flex: 1,
width: '100%',
height: '100%'
}}
style={{
flex: 1,
height: height,
width: width,
resizeMode: 'cover',
}}
/>
its working fine in ios
debug mode but not working in ios
production build.getting blank screen.
react-native-webview: "^11.18.1",
react-native: "0.64.2"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论