Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

New features for APNs token authentication now available
Team-scoped keys introduce the ability to restrict your token authentication keys to either development or production environments. Topic-specific keys in addition to environment isolation allow you to associate each key with a specific Bundle ID streamlining key management. For detailed instructions on accessing these features, read our updated documentation on establishing a token-based connection to APNs.
0
0
1.6k
Feb ’25
Transparent Proxy Provider, UDP, mbufs, and inevitable panics
First, for the  employees reading, I filed FB14844573 over the weekend, because this is a reproducible panic or hang. whee I ran our stress tests for an entire long weekend, and my machine panicked, due to mbufs. Normally, I tell my coworkers that we can't really do anything to cause a panic -- but we're doing network things, so this is an exception. I started periodically testing the mbufs while the tests were running -- netstat -m | grep 'mbufs in use' -- and noticed that in fact they were going up, and never decreasing. Even if I killed our code and uninstalled the extensions. (They're increasing at about ~4mbufs/sec.) Today I confirmed that this only happens if we include UDP packets: let udpRule = NENetworkRule(destinationNetwork: host, prefix: 0, protocol: .UDP) let tcpRule = NENetworkRule(destinationNetwork: host, prefix: 0, protocol: .TCP) ... settings.includedNetworkRules = [udpRule, tcpRule] If I comment out that udpRule, part, mbufs don't leak. Our handleNewUDPFlow(:, initialRemoteEndpoint:) method checks to see if the application is a friendly one, and if so it returns false. If it isn't friendly, we want to block QUIC packets: if let host = endpoint as? NWHostEndpoint { if host.port == "80" || host.port == "443" { // We need to open it and then close it flow.open(withLocalEndpoint: nil) { error in Self.workQueue.asyncAfter(deadline: .now() + 0.01) { let err = error ?? POSIXError(POSIXErrorCode.ECONNABORTED) flow.closeReadWithError(err) flow.closeWriteWithError(err) } } return true } } return false Has anyone else run into this? I can't see that it's my problem at that point, since the only thing we do with UDP flows is to either say "we don't want it, you handle it" or "ok sure, we'll take it but then let's close it immediately".
4
0
609
Dec ’24
Gift Subscription and Split Payment
I am the Lead iOS Developer for The Incc, an upcoming social networking application. The platform offers subscriptions that grant users access to premium content, primarily digital magazines showcasing diverse cultures, alongside standard social media features and additional unique functionalities. I am exploring two specific use cases for our subscription model. Promo Codes with Split Payments: We plan to collaborate with the our influencers (referred to as Mover Shakers) by providing them with promo codes for users to purchase subscriptions. For such purchases, we aim to implement a revenue split model, allocating 10% to the influencer and the remainder to us after Apple’s fees. Gifting Subscriptions: We also wish to enable users to gift subscriptions to others within the app. I understand that the Apple Subscription Service does not natively support these features. What other options do we have to achieve this that are also not against the Apple's guidelines.
0
0
321
Dec ’24
User-Generated Files in Documents Directory Deleted After App Restart on iOS 18.2 (iPhone 11)
Hello, I am encountering an issue with user-generated files stored in the Documents directory on an iPhone 11 running iOS 18.2. The problem occurs as follows: 1.The app generates and saves files in the Documents directory using FileManager. 2.These files are successfully saved and remain accessible while the app is running. 3.After restarting the app, the files appear to have been deleted from the Documents directory. I have confirmed that: 1.The files are being saved to the correct location (Documents directory) and can be accessed during the current app session and from iExplorer. 2.The app is not explicitly deleting these files during shutdown or restart. 3.This behavior is consistent across multiple app restarts.
0
0
235
Dec ’24
Ping DNS to check internet connection
I want to check if the device has a internet connection or not by pinging DNS "8.8.8.8". connection.send(content: content, completion: .contentProcessed {[weak self] error in send function is not returning any error even if the host is unreachable. I am checking if I can receive the data or not but connection.receiveMessage function never returns. This is the complete code which I am following: private let networkMonitor = NWPathMonitor() private var connection: NWConnection @MainActor var isConnectedToInternet = false init(host: NWEndpoint.Host = "8.8.8.8", port: NWEndpoint.Port = 53) { let endpoint = NWEndpoint.hostPort(host: host, port: port) connection = NWConnection(to: endpoint, using: .udp) startMonitoring() } private func startMonitoring() { networkMonitor.pathUpdateHandler = { [weak self] path in guard let self else { return } ping(callback: { isSuccess in print("***** ping status:", isSuccess) Task { @MainActor in self.isConnectedToInternet = isSuccess } }) } let queue = DispatchQueue(label: QueueLabel.networkMonitor) networkMonitor.start(queue: queue) } func ping( host: NWEndpoint.Host = "8.8.8.8", port: NWEndpoint.Port = 53, callback: @escaping ((Bool) -> Void) ) { var didSendState = false connection.stateUpdateHandler = {[weak self] state in guard let self = self else { return } guard !didSendState else { if state != .cancelled { cancel(connection) } return } switch state { case .ready: // State is ready now send data let content = "Ping".data(using: .utf8) let startTime = Date() connection.send(content: content, completion: .contentProcessed {[weak self] error in guard let self = self else { return } if error != nil { callback(false) didSendState = true cancel(connection) } else { print("Ping sent, waiting for response...") connection.receiveMessage { [weak self] content, _, _, receiveError in guard let self = self else { return } if let receiveError { print("Error receiving ping: \(receiveError.localizedDescription)") callback(false) } else if let content = content, String(data: content, encoding: .utf8) == "Ping" { let roundTripTime = Date().timeIntervalSince(startTime) print("Ping received! Round-trip time: \(roundTripTime) seconds") callback(true) } else { print("Invalid response received") callback(true) } didSendState = true cancel(connection) } } }) case .failed( _), .waiting( _), .cancelled: didSendState = true callback(false) case .setup, .preparing: // No callback because the ping has not yet succeeded or failed break @unknown default: didSendState = true callback(false) // We don't know what this unknown default means, so cancel pings to be safe cancel(connection) } } connection.start(queue: .main) } func cancel(_ connection: NWConnection) { connection.cancel() } } Can anyone please help what I am doing wrong.
2
0
300
Jan ’25
Зашел на чужой Apple ID под предлогом мошенников и не могу выйти
Здравствуйте, я зашел на чужой Apple ID под предлогом мошенников и теперь не могу выйти, помогите мне пожалуйста, это полностью мой телефон и я смогу доказать, что он мой.
1
0
317
Dec ’24
Feedback Assistant nonresponse
Hi All, Had a question. Is there a point to submit anything through the feedback assistant (https://feedbackassistant.apple.com)? I mean it doesn't seem like any engagement occurs through the platform on any issues submitted.
2
0
269
Dec ’24
Bluetooth connectivity
I upgraded my iPhone 13 Pro Max last week, but I am unable to connect my Sony WH-1000XM5 headphones via Bluetooth. I'm not sure why everything else connects just fine except my headphones. Please send help.
1
0
319
Dec ’24
App Clip Not Launching From Approved Apple Maps Action Link
We’ve set up an advanced App Clip experience that successfully launches when a user scans our QR code. However, the same App Clip invocation URL does not launch when tapping the associated Action Link on our Apple Place Card in Apple Maps. Instead of opening the App Clip, the link falls back to the website. What We Have Done So Far: App Clip Launched in App Store Connect: Our App Clip is approved and live on the App Store. Here is the invocation URL: https://appclip.parkzenapp.com/park?q=oJrbSIgx Below is the QR code for our Advanced App Clip experience we are attempting to open in our Apple Maps Place card When scanning the QR code that uses the same App Clip invocation URL, the App Clip reliably launches as expected. Here is our apple-app-site-association file, thats correctly served from the associated domain: https://appclip.parkzenapp.com/.well-known/apple-app-site-association Add here is a screenshot showing how the appclip.parkzenapp.com domain is correctly validated. Advanced App Clip Experience: We created and submitted an advanced App Clip Experience specifically tied to our location on Apple Maps. This App Clip Experience is approved and live. Below is an image of our set up of this Advanced App Clip Experience Business Connect: We've created the Apple Maps Location in business connect and added the advanced App Clip experience invocation URL as an Action Link in the place card. See screenshot below. Apple Maps Place: https://maps.apple.com/place?auid=906421750045811407 Despite meeting these conditions, when a user taps the Action Link (the "Reserve" button in the Apple Maps Place Card), the fallback website opens rather than the App Clip. Question: What additional step or configuration might we be missing to ensure the Action Link on our Apple Maps place card triggers the App Clip instead of the website? Thank you
0
0
501
Dec ’24
UIViewController.view.backgroundColor auto changed when present
This is easy to reproduce,in dark mode, 2 UIViewControllers A and B, A present B. code: class AAA: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "AAA" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { present(UINavigationController(rootViewController: BBB()), animated: true) } } class BBB: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "BBB" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { dismiss(animated: true) } } before present: after present: Obviously, the backgroundColor of the view has changed. I guess it's because view's backgroundColor is the same as the the window, so changed the color to distinguish between the controller and the background, but this brought unexpected changes which is confusing. I want to know how this happened and how I can manually control it
1
0
295
Jan ’25
Store Kit Set up
I'm working on my first subscription for an app I've built, and can't seem to figure out where I'm going wrong with this one whether it's something in Xcode or App Store Connect. Any idea where to start? Somethings to check. TIA.
0
0
277
Dec ’24
When user opened my application, it crashed immediately. [Firebase crash report CFNetwork]
When user opened my application, it crashed immediately. This is crash log message from firebase. com.apple.CFNetwork.Connection EXC_BAD_ACCESS KERN_INVALID_ADDRESS After restarting iPhone, user can use my application without crash. I cannot reproduce this crash from other device. Here are .ips crash log that I changed to .txt. crashLog-2024-12-26-182447.txt crashLog-2024-12-26-182449.000.txt crashLog-2024-12-26-182535.000.txt crashLog-2024-12-26-182535.txt Do you have any idea to fix this?
2
0
614
Jan ’25
AppIntents: Shortcuts phrases with parameters are not resolving correctly
Exploring AppIntents and Shortcuts. No matter what I try Siri won't understand parameters in an initial spoken phrase. For example, if I ask: "Start my planning for School in TestApp", Siri responds: "What's plan?", I say: "School" and Siri responds "Ok, starting Shool plan" What am I missing so it won't pick up parameters right away? Logs inside func entities(matching string: String) are only called after "What's plan?" question and me answering "School". No logs after the initial phrase Tried to use Apple's Trails example as a reference but with no luck
1
0
500
Dec ’24
Apple Healthkit data usage
I want to use the Apple Healthkit data to recommend personalised insurance. Is this allowed? As I have read in the documentation that the Apple Healthkit data can only be used for fitness and health purposes. Anyone knows what is meant / scope of "fitness and health purposes"? Will personalised insurance as per health data be allowed under this category?
0
0
392
Jan ’25
Can I ensure location is saved to SwiftData within Share Extension lifetime?
I am writing a SwiftData/SwiftUI app in which the user saves simple records, tagged with their current location. Core Location can take up to 10 seconds to retrieve the current location from its requestLocation() call. I the main app I have wrapped the CLLocationManager calls with async implementations. I kick off a Task when a new record is created, and write the location to my @Model on the main thread when it completes. A realistic use of the share extension doesn't give the task enough time to complete. I can use performExpiringActivity to complete background processing after the share extension closes but this needs to be a synchronous block. Is there some way of using performExpiringActivity when relying on a delegate callback from something like Core Location?
0
0
427
Dec ’24
Issue with Developer App Crashing on iPad Upon Launch
Recently, after updating the Developer app to the latest version, my iPad has been unable to open this app as it crashes immediately upon launch. Prior to the update, the app functioned normally. My device is an 11-inch iPad Pro from 2021, running iPadOS 17.3. I have tried troubleshooting steps such as reinstalling the app and restarting the device, but these actions have not resolved the issue. However, I need to use this specific version of the system, iPadOS 17.3, for software testing purposes and cannot upgrade the system. Other apps on my device work normally without any issues. Is there a solution to this problem? I have attempted to contact the developer support team in China, but they were also unable to provide a resolution. This issue is reproducible 100% of the time on my iPad.
1
0
360
Jan ’25