How to enable Flutter internet permission for macos desktop app?

6,740

You need to add:

<key>com.apple.security.network.client</key>
<true/>

to macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements.

This is documented here.

Share:
6,740
K.Os
Author by

K.Os

Updated on December 01, 2022

Comments

  • K.Os
    K.Os over 1 year

    I am trying to develop Flutter app which will run also on destkop. This app is using http package:

    import 'package:http/http.dart'
    

    When I am trying to perform http request I am getting this exception:

     SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = firebasedynamiclinks.googleapis.com, port = 443
    

    This app is working on Android and iOS, how to enable this permission for macos?

    I am using IntelliJ IDE, so this answer is not satisfying me Flutter - http.get fails on macos build target: Connection failed

  • smorgan
    smorgan about 4 years
    You should not do this with Xcode. See stackoverflow.com/questions/57841871/… and my comment in the question you linked to.
  • TomTom101
    TomTom101 over 2 years
    Very important: do not add any whitespace to the <key> node, sth. your IDE might do on save when formatting this file. This will result in obscure code signing issues later on.