sanguk.dev
작성완료
React Native http 통신 허용

React Native http 통신 허용

안드로이드에서는 AndroidManifest.xml 파일에 android:usesCleartextTraffic="true"를 추가하고, iOS에서는 info.plist 파일에 NSAppTransportSecurity 키 아래에 NSAllowsArbitraryLoads를 추가하여 http 통신을 허용해야 합니다.

React Native

Android

android/app/src/main/AndroidManifest.xml

xml
<manifest
  ...
>
  <application
    ...
    android:usesCleartextTraffic="true" // 추가
  >
    ...
  </application>
</manifest>

iOS

ios/project/info.plist

xml
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key> // 추가
    <true/> // 추가
</dict>