Add to app iOS 14 Info.plist network permissions#554
Merged
jmagman merged 1 commit intoflutter:masterfrom Sep 26, 2020
jmagman:a2a-bonjour
Merged
Add to app iOS 14 Info.plist network permissions#554jmagman merged 1 commit intoflutter:masterfrom jmagman:a2a-bonjour
jmagman merged 1 commit intoflutter:masterfrom
jmagman:a2a-bonjour
Conversation
jmagman
commented
Sep 26, 2020
Comment on lines
+44
to
+49
| <key>NSBonjourServices</key> | ||
| <array> | ||
| <string>_dartobservatory._tcp</string> | ||
| </array> | ||
| <key>NSLocalNetworkUsageDescription</key> | ||
| <string>Allow Flutter tools on your computer to connect and debug your application. This prompt will not appear on release builds.</string> |
Member
Author
There was a problem hiding this comment.
This is an exact copy of Info-Release.plist except for these two keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
iOS 14 requires
NSBonjourServicesin an app'sInfo.plistto prompt the user to give local network permissions to the app. The Flutter engine need this permission set to_dartobservatory._tcpin order to publish the dart VM service (observatory) port (debug/profile only), so the host tooling can discover the port and connect. Optionally,NSLocalNetworkUsageDescriptioncan also be set to customize the permission prompt.fluttertooling automatically handles this as of flutter/flutter#64988, but add-to-app hosts must add these keys manually. See also flutter/flutter#63893 and https://flutter.dev/docs/development/ios-14#debugging-flutter.Description
Updated the three
add_to_apphost apps. The following breakdown usesIOSFullScreenas an example.Info.plist to Info-Debug.plist. Made a copy of it calledInfo-Release.plistand added the second plist to the Xcode project.Info-Debug.plistonly addedNote: Xcode's plist editor displays

NSBonjourServicesas "Bonjour services" andNSLocalNetworkUsageDescriptionas "Privacy - Local Network Usage Description"Info.plist File(INFOPLIST_FILE) toIOSFullScreen/Info-$(CONFIGURATION).plist. This will resolve to the pathIOSFullScreen/Info-Debug.plistinDebugandIOSFullScreen/Info-Release.plistLaunching the app in debug now shows the local network permissions pop up:

Additionally, I added the missing
IOSFullScreenscheme file so the app can be launched from Xcode.