From d6f72be518fa26e3310f87273894f1a13cd1d2de Mon Sep 17 00:00:00 2001 From: Jordan Nelson Date: Thu, 20 Jun 2024 16:40:34 -0400 Subject: [PATCH] chore: add info to enable network permissions on android --- .../flutter/platform-setup/android.mdx | 13 ++++++++ .../[platform]/start/platform-setup/index.mdx | 31 +++++++++++++------ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/fragments/lib/project-setup/flutter/platform-setup/android.mdx b/src/fragments/lib/project-setup/flutter/platform-setup/android.mdx index ce3733e5d74..6bf26008f56 100644 --- a/src/fragments/lib/project-setup/flutter/platform-setup/android.mdx +++ b/src/fragments/lib/project-setup/flutter/platform-setup/android.mdx @@ -66,3 +66,16 @@ android { If you would like to use a higher version of Gradle or Android Gradle plugin see the compatibility matrix [here](https://developer.android.com/build/releases/gradle-plugin#updating-gradle). + +### Network Permissions for Release Builds + +Flutter apps have access to make network requests by default in debug mode. This permission needs to be added when building in release mode. To do this, open `android/app/src/main/AndroidManifest.xml` and make the following addition. + +```xml title="android/app/src/main/AndroidManifest.xml" + +// highlight-start + +// highlight-end +... + +``` diff --git a/src/pages/[platform]/start/platform-setup/index.mdx b/src/pages/[platform]/start/platform-setup/index.mdx index 72a319153bc..442c30f89fe 100644 --- a/src/pages/[platform]/start/platform-setup/index.mdx +++ b/src/pages/[platform]/start/platform-setup/index.mdx @@ -111,18 +111,31 @@ android { If you would like to use a higher version of Gradle or Android Gradle plugin see the compatibility matrix [here](https://developer.android.com/build/releases/gradle-plugin#updating-gradle). -## Web +#### Network Permissions for Release Builds + +Flutter apps have access to make network requests by default in debug mode. This permission needs to be added when building in release mode. To do this, open `android/app/src/main/AndroidManifest.xml` and make the following addition. + +```xml title="android/app/src/main/AndroidManifest.xml" + +// highlight-start + +// highlight-end +... + +``` + +### Web There are no Amplify specific requirements or setup instructions when targeting web. You will need to use a browser supported by Flutter. See the following Flutter docs for more info: - [Supported deployment platforms](https://docs.flutter.dev/reference/supported-platforms) - [FAQ: Which web browsers are supported by Flutter?](https://docs.flutter.dev/development/platform-integration/web/faq#which-web-browsers-are-supported-by-flutter) -## macOS +### macOS Amplify requires a minimum deployment target of 10.15 and Xcode 13.2 or higher when targeting macOS. Additionally, you will need to enable networking, keychain entitlements, and code signing. -### Update Minimum Version +#### Update Minimum Version From your project root, navigate to the `macos/` directory and open the `Podfile` in a text editor of your choice. Update the target macOS platform to 10.15 or higher. @@ -138,7 +151,7 @@ Select Runner, Project -> Runner and then the "Info" tab. Update "macOS Deployme ![Setting the macOS version to 10.15 or higher in the macOS Deployment Target tab of the Runner info section.](/images/project-setup/flutter/mac/project-min-deployment-version.png) -### Enable Network Calls +#### Enable Network Calls Open your project in Xcode and select Runner, Targets -> Runner and then the "Signing and Capabilities" tab. Under "App Sandbox" select "Outgoing Connections (Client)". @@ -146,7 +159,7 @@ Open your project in Xcode and select Runner, Targets -> Runner and then the "Si For more info on the Networking entitlement, see Apple's documentation on [com.apple.security.network.client](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_network_client). -### Enable Keychain Sharing +#### Enable Keychain Sharing @@ -175,17 +188,17 @@ Open your project in Xcode and select Runner, Targets -> Runner and then the "Si ![Team selector and Enable Development Signing button highlighted in the signing and capabilities section of the runner tab.](/images/project-setup/flutter/mac/enable-signing.png) -## Windows +### Windows There are no Amplify specific requirements or setup instructions when targeting Windows. You will need to use a Windows version supported by Flutter. See the following Flutter docs for more info: - [Supported deployment platforms](https://docs.flutter.dev/reference/supported-platforms) -## Linux +### Linux Amplify Flutter depends on the [libsecret](https://wiki.gnome.org/Projects/Libsecret) library when targeting Linux. -### Local Development +#### Local Development To run and debug an app that depends on Amplify Flutter, you must install `libsecret-1-dev`. Run the following commands to install `libsecret-1-dev`. this will also install dependencies of `libsecret-1-dev`, such as `libglib2.0-dev`. @@ -202,7 +215,7 @@ sudo apt-get install -y libsecret-1-dev {/* cSpell:enable */} -### Packaging Your App +#### Packaging Your App To include the required dependencies when packaging your app with Snapcraft, include them in your `snapcraft.yaml` file. For more info, see [Flutter's documentation on releasing to the Snap Store](https://docs.flutter.dev/deployment/linux).