출처: 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
'개발일지' 카테고리의 다른 글
Dartlang class에 Object를 argument로 넘겨주기 (0) | 2021.06.20 |
---|---|
뒷 배경에 이미지를 포함한 위젯 만들기 (0) | 2021.06.15 |
graphql_flutter subscription 구현 저장 (0) | 2021.05.13 |
Android studio snippet 추가하기 (0) | 2021.05.11 |
nestjs oneToMany/ManyToOne relation 오류 (0) | 2021.02.01 |