설치

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>
  );
}

트러블 슈팅

google sign in 에서 403 disallowed_useragent 가 뜨는 경우

Untitled

<WebView
	...
  userAgent="customUserAgent"
/>

userAgent를 customUserAgent 로 세팅 혹은 specific한 userAgent 지정

레퍼런스

Docs: Getting Started

react-native-webview/docs/Getting-Started.md at 71191608745862b262c3b2f1646bf14feac0f06b · react-native-webview/react-native-webview

Docs: Guide

react-native-webview/docs/Guide.md at master · react-native-webview/react-native-webview

Docs: API Reference

react-native-webview/docs/Reference.md at master · react-native-webview/react-native-webview

React Native WebView Component // Masterclass