This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Started printing out error messages when the observatory won't be reachable because of permissions problems. #20960
Merged
gaaclarke
merged 3 commits into
flutter:master
from
gaaclarke:local-network-permissions-errors
Sep 3, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,11 +113,25 @@ - (void)publishServiceProtocolPort:(NSString*)uri { | |
|
|
||
| if (err != 0) { | ||
| FML_LOG(ERROR) << "Failed to register observatory port with mDNS."; | ||
| if (@available(iOS 14.0, *)) { | ||
| FML_LOG(ERROR) << "Make sure the 'NSBonjourServices' key is set in your Info.plist for '" | ||
| << registrationType << "' for the Debug/Profile configurations." | ||
| << "(See also: https://developer.apple.com/news/?id=0oi77447)"; | ||
| } | ||
| } else { | ||
| DNSServiceSetDispatchQueue(_dnsServiceRef, dispatch_get_main_queue()); | ||
| } | ||
| } | ||
|
|
||
| /// TODO(aaclarke): Remove this preprocessor macro once infra is moved to Xcode 12. | ||
| static const DNSServiceErrorType kFlutter_DNSServiceErr_PolicyDenied = | ||
| #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you use a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Na, that's why I messed it up the first time. It's in an enum declaration that doesn't have annotations or guards of what version the operating system is. |
||
| kDNSServiceErr_PolicyDenied; | ||
| #else | ||
| // Found in usr/include/dns_sd.h. | ||
| -65570; | ||
|
Comment on lines
+131
to
+132
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| #endif // __IPHONE_OS_VERSION_MAX_ALLOWED | ||
|
|
||
| static void DNSSD_API registrationCallback(DNSServiceRef sdRef, | ||
| DNSServiceFlags flags, | ||
| DNSServiceErrorType errorCode, | ||
|
|
@@ -127,6 +141,11 @@ static void DNSSD_API registrationCallback(DNSServiceRef sdRef, | |
| void* context) { | ||
| if (errorCode == kDNSServiceErr_NoError) { | ||
| FML_DLOG(INFO) << "FlutterObservatoryPublisher is ready!"; | ||
| } else if (errorCode == kFlutter_DNSServiceErr_PolicyDenied) { | ||
| FML_LOG(ERROR) | ||
| << "Could not register as server for FlutterObservatoryPublisher, permission " | ||
| << "denied. Check your 'Local Network' permissions for this app in the Privacy section of " | ||
| << "the system Settings."; | ||
| } else { | ||
| FML_LOG(ERROR) << "Could not register as server for FlutterObservatoryPublisher. Check your " | ||
| "network settings and relaunch the application."; | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we point out it's only needed for Debug and Profile configuration
Info.plists? At some point we should write up some info on the website, but in the meantime...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sg, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug and Profile, not just Debug.