Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 '"
Copy link
Member

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...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sg, done.

Copy link
Member

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.

<< 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a @available here? I've needed to use this macro outside of the class (like for imports) but hopefully @available works inline? Not a big deal though.

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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,
Expand All @@ -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.";
Expand Down