6

I'm new to flutter and I'm in a situation to get internet permission for our flutter app which we are developing, we've used enter link description here for handling permissions. We also accessed microphone permission and it worked well. but can't get the internet permission request.

And I want to know whether internet permission(But I've mentioned in the Manifest.xml file) is not mandatory or not?

3
  • 1
    just write <uses-permission android:name="android.permission.INTERNET" /> in your anrdoidmanifest.xml file :)
    – hio
    Jul 15, 2020 at 6:08
  • 1
    @ParthPitroda, hey I know it's late to say a huge thanks for your comment,but ya,have a great day!
    – Aashiq
    Jan 31, 2021 at 6:06
  • Does this answer your question? ACCESS_NETWORK_STATE permission on Android ICS
    – Vega
    May 5, 2021 at 10:35

4 Answers 4

21

just write this in your Anroidmanifest.xml in android module in flutter project:

<uses-permission android:name="android.permission.INTERNET" />
2
14

Internet permissions are required for macOS in addition to Android so I'm adding an expanded answer.

Android

Add the following line in your AndroidManifest.xml file before the <application> section:

<uses-permission android:name="android.permission.INTERNET" /> 

See also the Flutter docs for creating an Android release.

macOS

Add the following key-value pair to macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements:

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

See also the Desktop support for Flutter documentation.

0
0

It can be a better solution . Paste the code below to android manifest.xml

uses-permission android:name="android.permission.INTERNET" / 

uses-permission
   android:name="android.permission.ACCESS_NETWORK_STATE"
1
0

Right-Click info.plist and Open As -> Source Code. This will open the file in XML format.

  • Add the following to the bottom of the info.plist xml file.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.