flutter Android https支持

flutter安卓支持https

  1. 开启网络权限
  2. 在AndroidManifest.xml文件中 在application下添加 android:usesCleartextTraffic="true"
<uses-permission android:name="android.permission.INTERNET" />
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="xx"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true"
        >

在iOS中如果支持https需要修改info.plist文件 添加如下字典

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

猜你喜欢

转载自www.cnblogs.com/qqcc1388/p/12633255.html