My application only loads one web page, but it is taking about 10 to 15 seconds to load the first time after installation, which caused Apple to reject my submission. My application was made in react-native.
I’m getting the returns in the compilation:
Warning: -[BETextInput attributedMarkedText] is unimplemented
WebContent process (0x11b01c680) took 1.044328 seconds to launch
Failed to request allowed query parameters from WebPrivacy.
My code:
import React, {useEffect, useState} from 'react';
import {View, Text, StyleSheet, SafeAreaView, BackHandler} from 'react-native';
import {WebView} from 'react-native-webview';
export default function App() {
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
BackHandler.addEventListener('backPress', () => true);
return () => BackHandler.removeEventListener('backPress', () => true);
}, []);
const handleLoad = () => {
setIsLoading(false);
};
return (
<SafeAreaView style={styles.container}>
<WebView
source={{uri: 'https://www.google.com'}}
style={styles.webView}
onLoad={handleLoad}
/>
{isLoading && (
<View style={styles.loadingContainer}>
<Text style={styles.loadingText}>Carregando...</Text>
</View>
)}
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
webView: {
flex: 1,
},
loadingContainer: {
...StyleSheet.absoluteFillObject,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
},
loadingText: {
fontSize: 20,
color: 'white',
},
});
I tried change my url, but it’s not work.
I remove my function to loading my web page and the erros and it was working, but i need use the functions.
Vitor Ernandes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.