Comments (11)
(OP originally posted this issue in my library that depends on nsd, so I pointed to this repo, but also I've done some digging and figured it's more relevant to post here.)
After about half an hour of nothing turning up in google, I finally ran across this: https://developer.apple.com/forums/thread/664548
TL;DR: try putting an extra period at the end of the service in the info.plist file: _http._tcp.
If that doesn't work, I guess read the full thread and see if any of it helps. I may not be available for about two weeks, so good luck, and let us know if it worked.
from nsd.
Thank you bro.
let me try this and get back to you in a few minutes.
from nsd.
No bro nothing works.. it still shows the same error.
from nsd.
Bummer. You read the thread? Did you see any errors in Console, like "App Info.plist(NSBonjourServices) does not allow..."? Come to think of it...my library takes the service id you give it and registers it as _SERVICEID._tcp
, so e.g. _foo._tcp
. This could be my fault for not reading the NSD instructions carefully enough, and not making my instructions match sufficiently. If you haven't, try swapping in your service ID in the info.plist. If that doesn't work, try adding the extra period. If that doesn't work, I guess check the Console to see what service id it's expecting? Maybe something else happens to the service id after my app is done with it. Lemme know what happened.
from nsd.
static const SERVICE_ID = "MYID";
Future<void> STARTSERVER() async
{
var zc = ZeroConnect(localId: "SAMSUNG2");
await zc.advertise(serviceId: SERVICE_ID, callback: (messageSock, nodeId, serviceId) async {
print("got message connection from $nodeId");
var str = await messageSock.recvString(allowMalformed: true,tryHard: true);
print(str);
await zc.close();
}
this is my code
and this is my info.plist
<key>NSLocalNetworkUsageDescription</key>
<string>Required to discover local network devices</string>
<key>NSBonjourServices</key>
<array>
<string>_http._tcp.</string>
</array>
when i click on button to execute this code it shows
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: NsdError (message: "missing required configuration", cause: internalError)
this error
from nsd.
I am new to Flutter and IOS. I don't know to use info.plist file please help
from nsd.
Try changing "_http._tcp." to "_MYID._tcp". If it doesn't work, try "_MYID._tcp.". If that doesn't work, then open the Console app on the mac and look at the phone's logs, like this: https://support.apple.com/guide/console/log-messages-cnsl1012/mac
Look for a line like the forum said, like "App Info.plist(NSBonjourServices) does not allow '_myprotocol._http._tcp.' for (My App)". Then copy the stuff in quotes into your info.plist .
Sorry, I don't have a mac to debug this myself.
from nsd.
no problem bro.
I am testing it and send you complete logs in a few minutes.
Thank you soo much for the help.
from nsd.
Wow, great help bro.
it got fixed by changing "_http._tcp." to "_MYID._tcp".
really sorry for my silly mistake.
Thank you so much <3
from nsd.
Awesome, glad it worked. I'll update my README accordingly. Uh, sorry NSD people. @ameetaujla , if it works, go ahead and close the issue. Good luck with your project.
from nsd.
@Erhannis no problem, it doesn't hurt to have an issue for this, maybe it will help other people with similar issues 🙂 I'm closing it now, since it seems to be resolved.
from nsd.
Related Issues (20)
- mDNS Service registered with nsd not resolving correctly. HOT 2
- Select on which network interface to search HOT 1
- Windows: when the device name contains Chinese, the client cannot find the service.
- Flutter windows app crashes randomly on start HOT 8
- stopDiscovery Not working giving below exception HOT 3
- nsd 2.3.1 Not compatible uuid 4.1.0 HOT 1
- (warning) 'com.haberey/nsd' channel message on a non-platform thread HOT 1
- `stopDiscovery` should `dispose()` the `Discovery` HOT 3
- Android: failure on unregistration does not report back to dart side HOT 1
- [Question] Unregistering service when app crushes or when a user terminated app in force. HOT 2
- Works on iOS sim but not on actual device HOT 1
- Include permissions as part of the dependency HOT 1
- Add Linux support HOT 2
- pub.dev Changelog tab is reversed
- Get all serviceTypes does not work
- Error running inside isolate
- Discovery not working on macOS
- '_services._dns-sd._udp' not working on real IOS device. HOT 3
- On Android, the IP address and not the hostname is returned in the host field of a Service after a discovery
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsd.