Getting internet permission in flutter app
Solution 1
just write this in your Anroidmanifest.xml in android module in flutter project:
<uses-permission android:name="android.permission.INTERNET" />
Solution 2
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.
Aashiq
Myself a very passionate on web-development and Javascript Frameworks,mostly React.Loves to work on cool projects and build great things.Learning through mistakes is my favourite job.
Updated on December 22, 2022Comments
-
Aashiq over 1 year
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?
-
Vega almost 3 yearsPlease don't copy other's answers. Instead flag for duplicate. stackoverflow.com/a/40458189/5468463
-
Dc7 over 2 yearsWhat to do in iOS ?
-
hio over 2 yearsfor ios as far as IK there is no need :- stackoverflow.com/questions/61430142/…