Closed ameetaujla closed 1 year ago
(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.
Thank you bro.
let me try this and get back to you in a few minutes.
No bro nothing works.. it still shows the same error.
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.
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
I am new to Flutter and IOS. I don't know to use info.plist file please help
Try changing "
Sorry, I don't have a mac to debug this myself.
no problem bro. I am testing it and send you complete logs in a few minutes. Thank you soo much for the help.
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
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.
@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.
Description
Hello bro
thanks for this plugin it works great on android and on an ios emulator but not working on real ios device iPad or iPhone it shows an error Unhandled Exception: NsdError (message: "missing required configuration", cause: internalError)
I have also added NSLocalNetworkUsageDescription Required to discover local network devices NSBonjourServices
_http._tcp to my info file but nothing works..
please help
Thanks
Scenario
Use the plugin in my own application via Flutter dependency
Platform
None