개발일지
http 연결 허용시키기
케이오스
2021. 5. 22. 01:18
출처: https://stackoverflow.com/questions/64172791/flutter-insecure-http-is-not-allowed-by-platform
45
Generally it is required (and preferable) to use https links rather than http links. However, this can be overridden as shown below.
Android
Open the AndroidManifest.xml file in the android/app/src/main folder. Then set usesCleartextTraffic to true.
<application ... android:usesCleartextTraffic="true" ... >
See this question for more.
iOS
Open the Info.plist file in the ios/Runner folder. Then add the following key.
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
See this answer for more.
macOS
This is the same as iOS. Open the Info.plist file in the macos/Runner folder. Then add the following key.
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Follow
answered Jan 15 at 4:57
363k231 gold badges1150 silver badges1194 bronze badges
- For those testing on iOS and wondering where to put code in Info.plist; place the code in the iOS answer between the <plist><dict></dict></plist> tags. Also, double check that your hosts firewall is not enabled. – shennan 2 days ago