Post

Replies

Boosts

Views

Activity

Reply to Change hostname on NWListener
Have you tried escalating that with the app’s author? Working around their limitations is tricky, and it’s not going to get less tricky over time. I already tried this approach but it didn't work unfortunately. As to how you might work around this, the DNS-SD API (<dns_sd.h>) has a DNSServiceRegisterRecord routine that lets you register arbitrary records. I believe that you’ll be able to use this to register A and AAAA records for your device. Yes it's what I tried 2 days ago but the Domain on iOS never been registered. The API itself returns ok without error. This is the code: DNSServiceErrorType err; char txtMac[255]; TXTRecordRef recordMac; TXTRecordCreate(&recordMac, 255, &txtMac); err = TXTRecordSetValue(&recordMac, "mac-address", mac.toUtf8().length(), mac.toUtf8()); err = TXTRecordSetValue(&recordMac, "serial-number", serialN.toUtf8().length(), serialN.toUtf8()); err = TXTRecordSetValue(&recordMac, "ble-service-uuids", ble_uuids.toUtf8().length(), ble_uuids.toUtf8()); DNSRecordRef recordRef; const char *hostname = "WAHOO KICKR 0000H" DNSServiceErrorType error; DNSServiceRef dnsRef; struct in_addr *addr = atoaddr("192.168.0.46"); error = DNSServiceCreateConnection(&dnsRef); error = DNSServiceRegisterRecord(dnsRef, &recordRef, kDNSServiceFlagsUnique | kDNSServiceFlagsShareConnection, 0, hostname, kDNSServiceType_A, kDNSServiceClass_IN, sizeof(struct in_addr), addr, 240, TXTRegisterCallback, NULL); err = DNSServiceRegister(&ref1, 0, 0, serverName.toUtf8().constData(), "_wahoo-fitness-tnp._tcp", "local", serverName.toUtf8().constData(), htons(serverPort), strlen(txtMac) /* txtLen */, txtMac /* txtRecord */, register_reply_callback, NULL); DNSServiceProcessResult(ref1); I can see everything correct using the Discovery app, for example, but the domain is not registered. Is this API requires some special entitlement or something on iOS? I don’t know if any of this requires the multicasts entitlement. It’s pretty obscure stuff. Yes it's my fear too. Also if I can access to the entitlement, I can directly use the code that was working since iOS 16.1
Nov ’22
Reply to Change hostname on NWListener
My advice is that you try it on the Mac, just for testing purposes. macOS does not implement local network privacy, so there’s no potential for that to get in the way. And you can do your initial prototype with the dns-sd tool. Are you sure about this? All this problem started when iOS 16.1 and Ventura released in the same day. So I guess there is the same limitation. The issue is not present in iOS < 16.1 and on MacOS < Ventura.
Nov ’22