I am trying to setup an extension using DNSProxyProvider that intercepts the DNS traffic on UDP and inserts our custom device identifier and send it to our custom DNS Server which gives us the response which I forward to the requesting client.
I have been able to append the identifier with the domain name when sending out request to our custom DNS and I am getting the response back just fine but when I try to write the response to the udpflow I get this error in Console Logs.
Error Domain=NEAppProxyFlowErrorDomain Code=9 "The datagram was too large" UserInfo={NSLocalizedDescription=The datagram was too large}
Here is what I have tried so far.
Truncating the datagram size to less than 10 bytes.
Sending in dummy Data object while trying to write to the flow.
Double checking the Signing and Capabilities, for Targets, the App and Network Extension.
Attached below is code from my NEDNSProxyProvider. The DNS request is process in the handleNewFlow function which calls processUDPFlow
override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {
if flow is NEAppProxyTCPFlow {
NSLog("BDDNSProxyProvider : Is TCP Flow...")
} else if let udpFlow = flow as? NEAppProxyUDPFlow {
NSLog("BDDNSProxyProvider: handleNewFlow : \(udpFlow)")
processUDPFlow(udpFlow) // < --
}
return true
}
In the code below I concatenate domain name in the request with deviceId and send it to our server. Also have the Logs lines in, please ignore them.
// Read incoming DNS packets from the client
self.udpAppProxyFlow = udpFlow
udpFlow.readDatagrams { datagrams, error in
if let error = error {
NSLog("Error reading datagrams: \(error.localizedDescription)")
return
}
guard let datagrams = datagrams else {
NSLog("No datagrams received.")
return
}
// Forward each DNS packet to the custom DNS server
for (index, packet) in datagrams.enumerated() {
let dnsMessage = self.parseDNSMessage(from: packet.0)
NSLog("tDatagram Header: \(dnsMessage.header)")
for question in dnsMessage.questions {
NSLog("tDatagram Question: \(question.name), Type: \(question.type), Class: \(question.klass)")
}
for answer in dnsMessage.answers {
NSLog("tDatagram Answer: \(answer.name), Type: \(answer.type), Data: \(answer.data)")
}
let oldDomain = self.extractDomainName(from: packet.0)!
let packetWithNewDomain = self.replaceDomainName(in: packet.0, with: "827-\(oldDomain)") // func to append device ID
NSLog("Packet's new domain \(self.extractDomainName(from: packetWithNewDomain ?? packet.0) ?? "Found nil")")
self.sendToCustomDNSServer(packetWithNewDomain!) { responseDatagram in
guard let responseDatagram = responseDatagram else {
NSLog("Failed to get a response from the custom DNS server")
return
}
let tDatagram = (responseDatagram, packet.1)
udpFlow.writeDatagrams([tDatagram]) { error in
if let error = error {
NSLog("Failed to write DNS response back to client: \(error)")
} else {
NSLog("Successfully wrote DNS response back to client.")
}
}
}
}
// Continue Reading Datagrams - DO NOT REMOVE!
self.processUDPFlow(udpFlow)
}
}
Following is the function I use to replace domainName
// Ensure the datagram is at least the size of the DNS header
guard datagram.count > 12 else {
NSLog("Error : Invalid datagram: Too small to contain a DNS header")
return nil
}
NSLog("BDLine 193")
// Start reading after the header (12 bytes)
var offset = 12
// Parse the original domain name
while offset < datagram.count {
let length = Int(datagram[offset]) // Get the length of the next label
offset += 1
// Check for the null terminator (end of domain name)
if length == 0 {
// Domain name ends here
break
}
// Validate that the length is within bounds
guard offset + length <= datagram.count else {
NSLog("Error : Invalid datagram: Domain name length exceeds packet size")
return nil
}
// Skip over this label
offset += length
}
Everything is falling into place other than this last Error I get when I try to write back to flow. What am I missing here and how can I resolve this issue?
Any help would be appreciated.
Thanks
Dive into the vast array of tools, services, and support available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Good Hello,
I'm looking for the invoice for the developer account but I can't get my hands on it, does anyone know where it's hidden?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
I want to set the minimum deployment to 16.0, however Xcode (16.2) won't let me select that.
In the drop down box it shows 18,17,16,15, however if any of these is selected it sets them as 18.6, 17.6, 16.6 or 15.6 (see image)
If an attempt is made to edit the value manually, to 16.0, then after change it, Xcode just deletes that value and sets it to nothing.
What's going on here? Why is Xcode only allowing the version other than be something.6 and why will it not let you manually edit it?
I have tried all of the above options, cleaned cached data, restarted several times, did not work.
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
System Information
macOS Version 15.2 (Build 24C101)
Xcode 16.2 (23507) (Build 16C5032a)
iOs 18.1.1
Is there any way to modify the behaviour of this command? I really dislike that it adds a break after the opening parenthesis and would also prefer it to use the traditional multi-line style where the lines are aligned with their semicolons.
Alternatively, is there a way to run the "Format File with 'swift-format'" command without implicitly triggering "Format to Multiple Lines", as it apparently does? Having to reformat my method's signatures afterwards really makes this feature unattractive to me at the moment.
Topic:
Developer Tools & Services
SubTopic:
Xcode
I am a new user of PyCharm, but have years of experience with MacOS, python and similar. My set up is MacBook Pro M1, 32GB ram, MacOS Sequoia 15.2, and PyCharm Pro latest.
Path to projects leads to an external SSD via usb-c. I have set up some projects, each using python 3.12 in a venv.
The projects work for a while then “lose” a module (module not found). I have gone through every troubleshooting method the built-in AI and web search have come up with.
The first module to disappear is docx2txt. I created a new project and it worked, for a couple of days then the error returned. The docx2txt module could not be found working within or outside of PyCharm. In site-packages there is no “docx2txt” folder, only an “info” folder containing WHEEL and its companions.
For the most recent disappearance, I noticed the package used distutils. I cloned the docx2txt project from GitHub and updated setup.py to use setup tools instead of distutils, and installed it. Python invoked from the command line can import it, but not from PyCharm. When I run the project from PyCharm, the interpreter cannot find dotenv.
I have lost days of work time at this point so I am a bit worried. Advice on what to look at and for would be great.
Topic:
Developer Tools & Services
SubTopic:
General
I'm a noobie but doing a tutorial where it requires me to add these capabilities to my project.
Access Wi-Fi Information
Network Extentions
Bonjour Services
I have the Access Wi-Fi and Network Extentions installed but I could not find Bonjour Services
Any help would be much appreciated!
Thanks
Topic:
Developer Tools & Services
SubTopic:
Xcode
I'm new to Xcode and decided to give it a try, however, I'm unable to preview even the default "hello, world" message.
I've tried downloading Xcode on the App Store on Mac and from the official website, but I couldn't go pass the "Preparing (Automatic) iPhone Simulator."
I've also tried the following line of code on Terminal, but nada:
xcrun simctl erase all
Here's what I see for almost two hours now (it makes no sense):
My system specs:
iMac Retina 4K, 21.5-inch, 2019, 3 GHz Intel Core i5 6-Core, Radeon Pro 560X 4 GB, 8 GB 2667 MHz DDR4 (two 4gb core each), 1TB SSD.
I've coded way bigger web projects using various applications, but Xcode can't even preview the sample file?
Please, help. I would really like to code using Swift. :)
Hey guys,
I'm having an issue while trying to enrol myself in apple developer program. When I submit my information, I can only see an error saying "Your enrollment in the Apple Developer Program could not be completed at this time." And this is an infinite loop. How I can get myself enrolled in the program now?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Hi, I have recently downloaded the app to start learning how to code in swift and so on.
On my first try I have gotten the error stating that ”.swiftpm files cannot be opened”. I have followed some forum posts. I restarted my iPad several times and redown the app several times. I tried to disable the iCloud sync but I think I deleted the iCloud directory entirely that just results in the app closing on any action taken. (such as pressing the “New App” option or choosing the quick actions to make apps).
Is there a way to fix this?
Any help is appreciate, please ask me to provide any extra needed information.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift Playground
Playground Support
Hey,
In the UI of the Instruments app, I can change the recording mode to immediate. Is that possible when using xctrace? It seems to use deferred as a default.
I've tried to create a template, set the recording mode to immediate, and use that template for recording. However, that doesn't seem to work. At least the exported TOC of the .trace will have the following summary:
<summary>
<start-date>2025-01-11T13:00:11.365+01:00</start-date>
<end-date>2025-01-11T13:00:30.525+01:00</end-date>
<duration>19.160279</duration>
<end-reason>Target app exited</end-reason>
<instruments-version>16.0 (16A242d)</instruments-version>
<template-name>core_animation_fps</template-name>
<recording-mode>Deferred</recording-mode>
<time-limit>12 hours</time-limit>
</summary>
This issue might be related to: https://developer.apple.com/forums/thread/735948
Thanks a lot!
I can sucessfully send pushes to an app (which has been installed/run via Xcode) when the pushes are going through the Apple sandbox server.
However I want to test the server is configured correctly to send them through the Apple production server.
In the Xcode scheme I tried to change the build configuration to release (and ticked debug executable off) ,however the pushes still only work when sent through the sandbox.
Is there a way of installing/running the app using Xcode such that its compatible with the push production environment?
Does the APS Environment entitlement come into play here? this only ever says development.
(The app is on behalf of a 3rd party company, they've added me to their apple developer account but with limited powers, I can't upload to Testflight nor make an ad-hoc release with with to test with)
In my Swift app, Xcode has decided to put various important settings like, SWIFT_VERSION under "User Defined."
Does anyone know why?
Dear Apple Developer Support Team,
I am reaching out regarding an issue with completing the $99 payment for my Apple Developer Business account, which has already been verified. Despite several attempts, the payment process has not been successful.
Here is a summary of my attempts:
I tried making the payment using local bank cards from Sri Lankan banks (BOC, HNB, and Commercial Bank), but these were declined.
Following your advice from my support ticket, I attempted payment using a foreign card while in Sri Lanka, but this also failed.
Assuming the issue might be related to my location, I asked a friend in the UK to make the payment using her card. The transaction was processed successfully, but it has now been four days with no updates or progress.
I would appreciate your assistance in resolving this matter as soon as possible. Please let me know if any further information is required to expedite the process.
Thank you for your time and support.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Hi, I am looking for work right now and not able to afford the Developer account/license, is it possible to remove all currently registered iPhone devices from my development account?
All of the devices registered are long from the past and no longer available. How do I clear these out so I can test apps out against my current iPhone?
Thanks! 😊
i need help!
we bought keyboard after keyboard, and nothing seems to work.
my ipad pro, 7th gen, 13 inch, is not typing whatsoever with the magic keyboard unless i hold the keys.
it did this with a logitech keyboard as well.
Topic:
Developer Tools & Services
SubTopic:
General
I am trying to update my AboutView.xib file (https://git.callpipe.com/AccelerateNetworks/an-mobile-ios/-/blob/main/Classes/Base.lproj/AboutView.xib) through the xcode interface builder, and the changes that I make are correctly reflected in the wysiwyg, as well as in the file itself. However, I whenever the app is built and installed, it shows an older version of the about page.
Things I have tried to resolve this are (not listed in order):
Product > Clean Build Folder
Uninstall and reinstall the app
Restart the phone
Restart xcode
Restart the computer
Test a build created through xcode cloud
rm -rv ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
Changing something in the xib file (hoping it will recognize a change)
The only time the about page has shown something different is when I deleted the xib entirely. The project still built and deployed to the test device, but the about page was completely blank. This tells me I am working with the correct file, and when I look at the xml contents of the file, I can't find any of the old strings that are showing up.
What the editor shows:
What the app shows:
Topic:
Developer Tools & Services
SubTopic:
Xcode
I'm implementing Apple wallet extension in an iOS app. Currently following this documentation
https://developer.apple.com/documentation/passkit/implementing-wallet-extensions
I'm facing challages while testing the extension. Any suggestion how can i test it during developmet. Like if i want to test the storyboard from Wallet UI extension.
Any suggestions or helping material would be appriciated.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Wallet
Extensions
iOS
Swift
Got a Watch SE recently only to find out that I can't deploy apps to it from Xcode even once.
I always get the message "Connecting to Watch" and "Reconnecting to Watch".
Tried with Xcode 16 and then with 16.2. Same result.
For countless times, I have tried every possible solution posted on this forum and elsewhere but to no avail.
Filed a feedback, no reply yet from Apple.
Looks like something is seriously broken. Please fix this.
FB16122816
Hello Apple Developer Support,
I hope this post finds you well. I have several questions regarding the refund process, developer commission, and revenue payout, and I would appreciate your insights on the following:
1/ Refund Process:
When a customer cancels an order, when will Apple process the refund for the developer? How long does it typically take for developers to receive the refunded amount?
2/Developer Commission:
How does the commission for developers work in the event of a refund? Does Apple adjust the commission or deduct any percentage in case of a refund?
3/Refund Notifications:
Is there a notification system that alerts developers when a customer cancels an order and a refund is processed?
4/Revenue Payout:
How long does it take developers to receive the revenue from purchases, and is there a specific payout schedule for this?
5/Commission Percentage for Small Earnings:
If the developer's total earnings are under 1 million VND, what is the commission rate that applies?
Thank you in advance for your assistance. I look forward to your response.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Subscriptions
In-App Purchase