Code Monkey home page Code Monkey logo

Comments (11)

Erhannis avatar Erhannis commented on September 21, 2024

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

ameetaujla avatar ameetaujla commented on September 21, 2024

Thank you bro.

let me try this and get back to you in a few minutes.

from nsd.

ameetaujla avatar ameetaujla commented on September 21, 2024

No bro nothing works.. it still shows the same error.

from nsd.

Erhannis avatar Erhannis commented on September 21, 2024

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.

ameetaujla avatar ameetaujla commented on September 21, 2024
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.

ameetaujla avatar ameetaujla commented on September 21, 2024

I am new to Flutter and IOS. I don't know to use info.plist file please help

from nsd.

Erhannis avatar Erhannis commented on September 21, 2024

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.

ameetaujla avatar ameetaujla commented on September 21, 2024

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.

ameetaujla avatar ameetaujla commented on September 21, 2024

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.

Erhannis avatar Erhannis commented on September 21, 2024

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.

sebastianhaberey avatar sebastianhaberey commented on September 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.