yarn add react-native-webview
패키지 설치
cd ios
pod install
네이티브(iOS / Android) 디펜던시 설정 중 링크는 autolinking이 처리하지만 pod install 은 해줘야 함
function App(): React.JSX.Element {
return (
<SafeAreaView style={{flex: 1}}>
<WebView originWhitelist={['*']} source={{uri: '<https://example.com>'}} />
</SafeAreaView>
);
}
disallowed_useragent 가 뜨는 경우
<WebView
...
userAgent="customUserAgent"
/>
userAgent를 customUserAgent 로 세팅 혹은 specific한 userAgent 지정
react-native-webview/docs/Guide.md at master · react-native-webview/react-native-webview
react-native-webview/docs/Reference.md at master · react-native-webview/react-native-webview