Post

Replies

Boosts

Views

Activity

Scanning QR code with AVCaptureDevice issues on iPhone 14 Pro
Hello, I am using simple AVCaptureDevice setup to scan QR code from LCD screen, usually the distance is 5 to 15 centimeters. This has been working fine for a long time, with correct focus and everything. Today I noticed that my iPhone 14 Pro cannot focus on these smaller distances while my developer iPhone SE 2020 can easily detect the QR code in basically all cases. I have been using this code to create the capture device: AVCaptureDevice.default(for: .video) And then some settings: if videoCaptureDevice.isAutoFocusRangeRestrictionSupported { videoCaptureDevice.autoFocusRangeRestriction = .near } if videoCaptureDevice.isFocusModeSupported(.continuousAutoFocus) { videoCaptureDevice.focusMode = .continuousAutoFocus } As I said, this worked great prior to noticing the issue on iPhone 14 Pro. After some searching I found recommendations to use another device type like: builtInDualWideCamera and other available types. I tried all of them and they either behave like the default (meaning I cannot scan the code unless I move the phone way out) or they always seem to use the 0.5 Ultra-Wide camera which looks weird and the scanning experience is not ideal. What is the best approach to have QR scanning with these new phones?
3
1
3.6k
Dec ’22
New subscription stuck in "Waiting for Review"?
Hello, I submitted new app update almost a week ago for review, it got rejected one time (I had to add links to privacy policy) and then the version was approved. But my newly added subscription has some "Developer Action Needed" / "Rejected" issue - probably with the localization. I wasn't able to discover the root cause for the rejection so I updated the info to make it clear in my view and resubmitted. However I did not get any confirmation email or something like that and my subscription is "Waiting for Review" for days now, which means I am not able to proceed with the launch of new version. Is there anything I can do? I looked into requesting the expedited review - but I dont see any option to specify I need review of subscription. If I have App Store product page in multiple languages - must the subscription localizations match?
3
0
2.1k
Jan ’23
Weird NSCocoaErrorDomain errow when trying to autorize Screen Time API
Hello, we have rare case of AuthorizationCenter.shared.requestAuthorization(for: .individual) failing to autorize user on real device - iPhone XR (iOS 16.1.2). It does not throw the standard FamilyControlsError which we are handling, but NSCocoaErrorDomain. This is the entire po description: Error Domain=NSCocoaErrorDomain Code=4864 "The given data was not a valid property list." UserInfo={NSCodingPath=(), NSDebugDescription=The given data was not a valid property list., NSUnderlyingError=0x283af4d80 {Error Domain=NSCocoaErrorDomain Code=3840 "Cannot parse a NULL or zero-length data" UserInfo={NSDebugDescription=Cannot parse a NULL or zero-length data}}} The localized one says: "The data couldn’t be read because it isn’t in the correct format." This sounds like some error deep in iOS. The testing device has Apple ID logged in and uses passcode. Anything we can do on our end to solve this issue?
3
0
2k
Jan ’24
FamilyControls: FamilyActivityPicker needs bug fixes and parity with the system picker
Hello, we have been using the new Screen Time APIs for a long time. While the API is simple to work with, we have persistent issues with the FamilyActivityPicker component. I have filled many feedbacks but have yet to notice any changes/fixes in the point releases. One issue we see frequently is that expanding categories does not work. Instead, the picker shows just a single row, and you need to scroll up or down to “refresh” it and make it expand correctly. Another problem is that some apps are “hidden” in the “Other” category, and our users have trouble discovering them. I have been part of a few user interviews we did recently, and basically, every user had some issue with the FamilyActivityPicker. For one user, it just disappeared, and they needed to re-open the app screen, which contains the picker, to fix it. Sometimes the picker shows apps that have already been uninstalled from the device. The system picker from Screen Time works much better. For one, websites have dedicated category, which makes it much easier to navigate. I have seen instances where you would open the “Productivity” category and see like 50 websites - making it super hard to find apps. The system picker also allows users to manually enter a website that FamilyActivityPicker does not provide. Also, the system picker offers a search bar which is not possible with FamilyActivityPicker. Some users get frustrated with finding the specific apps in the picker if they have many apps installed. Since FamilyActivityPicker is critical to user experience in our app, we would appreciate it if the FamilyActivityPicker would be on par with the Screen Time built-in picker. Thanks 🙏
3
1
1.9k
Apr ’23
Stability issues with ManagedSettings on iOS 16.6? Lots of new crashes
Hello, I am curious if someone else also noticed this. We have started getting reports about our app not working correctly (mostly related to the Device Activity monitor that "runs" in the background, https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor). Upon checking the Xcode Organizer I can see somewhat significant amount of crashes that mostly appear to happen on iOS 16.6 - it is possible that our users don't wait with updating iOS but still looks suspicious. The crashes are related to ManagedSettings calls outside our own code. We haven't changes this code in a while so this coupled with the fact that these crashes happen "deep" in the ManagedSettings framework leads me to believe there is some other issue.
3
0
1.1k
Sep ’23
DeviceActivityReport no longer works on iOS 16 with Xcode 15
Hello, we had working DeviceActivityReport in our app for months now. However when building with Xcode 15 (previously betas, now the GM), the activity reports no longer displays anything on iOS 16 devices. If we run it with Xcode 14, it works. But with Xcode 15 builds, the device activity report only works on iOS 17 devices :( I am able to see some somewhat generic errors in the Console.app when opening screen that contains the report. -[_EXServiceClient launchWithConfiguration:error:]_block_invoke failed with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=<private>}}} Failed to create extensionProcess for extension '<private>' error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=<private>}}}. Failed to make extensionProcess with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=<private>}}} Failed to get extension process and XPC endpoints with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=<private>}}} And I managed to find one error that is specific to our activity extension which says just: Cannot track instance that is already dead!
3
3
1.8k
Sep ’23
`NEPacketTunnelProvider` configuration rarely gets duplicated
Hello, with iOS 16 (multiple betas), I noticed that our VPN configuration created with NEPacketTunnelProvider appears twice in Settings -> General -> VPN & Device Management. I thought that this shouldn't be possible (even if I wanted to) because on iOS apps can provide just one configuration? All the basic configuration for your VPN is static. providerBundleIdentifier & serverAddress are contants in the source code. The only thing that gets changed is onDemandRules. When I inspected the configurations details in Settings, they were identical.
2
0
718
Sep ’22
Detect images in document scans with Vision?
Hello, I am working on an app that scans documents and recognizes the text with help of Vision framework. This works great. I would also like to "recognize" or detect individual images which are part of the document. Does Vision has any support for this or should I be looking into training my own ML model? Below is an example document - I would like to extract the text (already done) and also the image of the building.
2
0
1.1k
Oct ’22
Weird UI glitch in horizontal Collection View section
Hello, my app sometimes has this super weird issue with scroll in a horizontal section (see the GIF below). The thing is, I have ever spotted it only in this third section and not the two sections above it. All have the same compositional collection view layout and are powered by the diffable data source. I reexamined the item definition and I don't think this could be a case of hash values being same and hence confusing the collection view. It also seems to happen only to these first items. It is not frequent but on my own device I have seen it many times so far. The problem always seems to manifest in similar manner. Anyone seen this? I am hoping that maybe someone will recognize the problem from the GIF.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
417
Jul ’24
Safari Content Blocker fails to reload with large amount of rules (but under limit)
Hello, I am developing Safari Content Blocker extension and discovered that it frequently fails to load with large amount of rules. Currently I have over 45k and most of the time when I reload the extension on iOS 18 (iPhone 12) it ends with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.SafariServices.ContentBlockerLoader" UserInfo={NSDebugDescription=connection to service named com.apple.SafariServices.ContentBlockerLoader} #0 And the simpler message is just: Couldn’t communicate with a helper application. From what I managed to find (for example here - https://developer.apple.com/forums/thread/756931) the limit for blocking rules should be 150k items. It was previously 50k but got increased years ago. Is there anything special I need to do to get the extension to work reliably with say 100k items? I am usng the JSON format from the docs: { "trigger": { ... }, "action": { ... } }, { "trigger": { ... }, "action": { ... } } ] My trigger is url-filter and the action is type: block I was thinking about providing multiple JSON files in attachments property of NSExtensionItem but apparently that is not supported. Thanks for help!
2
0
593
Feb ’25
Issues with saving `AVAudioFile` - playable, no sound
Hello, I am trying to use AVAudioFile to save audio buffer to .wav file. The buffer is of type [Float]. Currently I am able to successfully create the .wav files and even play them, but they are blank - I cannot hear any sound. private func saveAudioFile(using buffer: [Float]) { let fileUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("\(UUID().uuidString).wav") let fileSettings = [ AVFormatIDKey: Int(kAudioFormatLinearPCM), AVSampleRateKey: 15600, AVNumberOfChannelsKey: 1, AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue ] guard let file = try? AVAudioFile(forWriting: fileUrl, settings: fileSettings, commonFormat: .pcmFormatInt16, interleaved: true) else { print("Cannot create AudioFile") return } guard let bufferFormat = AVAudioFormat(settings: settings) else { print("Cannot create buffer format") return } guard let outputBuffer = AVAudioPCMBuffer(pcmFormat: bufferFormat, frameCapacity: AVAudioFrameCount(buffer.count)) else { print("Cannot create output buffer") return } for i in 0..<buffer.count { outputBuffer.int16ChannelData!.pointee[i] = Int16(buffer[i]) } outputBuffer.frameLength = AVAudioFrameCount(buffer.count) do { try file.write(from: outputBuffer) } catch { print(error.localizedDescription) print("Write to file failed") } } Where should I be looking first for the problem? Is it format issue? I am getting the data from the microphone with the AVAudioEngine. Its format is created like this: let outputFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: Double(15600), channels: 1, interleaved: true)! And here is the installTap implementation with the buffer callback: input.installTap(onBus: 0, bufferSize: AVAudioFrameCount(sampleRate*2), format: inputFormat) { (incomingBuffer, time) in DispatchQueue.global(qos: .background).async { let pcmBuffer = AVAudioPCMBuffer(pcmFormat: outputFormat, frameCapacity: AVAudioFrameCount(outputFormat.sampleRate * 2.0)) var error: NSError? = nil let inputBlock: AVAudioConverterInputBlock = { inNumPackets, outStatus in outStatus.pointee = AVAudioConverterInputStatus.haveData return incomingBuffer } formatConverter.convert(to: pcmBuffer!, error: &error, withInputFrom: inputBlock) if error != nil { print(error!.localizedDescription) } else if let pcmBuffer = pcmBuffer, let channelData = pcmBuffer.int16ChannelData { let channelDataPointer = channelData.pointee self.buffer = stride(from: 0, to: self.windowLengthSamples, by: 1).map { Float(channelDataPointer[$0]) / 32768.0 } onBufferUpdated(self.buffer) } } } The onBufferUpdated is the block that provides [Float] for the saveAudioFile method above. I have tried some experiements with different output formats, but that ended up with unplayable audio files.
1
0
1.9k
Jan ’22
How to shield categories with the ManagedSettingsStore?
Hello, I am not quite sure, how the shielding of entire categories of apps is supposed to work. The FamilyActivitySelection contains tokens for apps, websites and categories. But the shield property of ManagedSettingsStore has only attributes applications and webDomains where I can configure the tokens from the family activity selection. shield.applications = selection.applicationTokens shield.webDomains = selection.webDomainTokens I would expect there to be the property categories that expects Set<ActivityCategoryToken> and based on this shields apps in that category.
1
0
1.4k
Jul ’22
Cannot submit in-app with new buid: Unable to get the in-app approved
Hello, I have added new non-consumable in-app to my existing app. Initially I messed up and sent it to review by itself (since in-apps and regular submissions seem to be handled by different teams). It got rejected and the review notes said that the review couldn't be done, because they couldn't test it in the app. Makes sense. So I submitted new build to app review and then submitted the in-app again. Same rejection reason. The build got approved, the in-app got rejected. After my newest build was approved. I added note in the review notes that the in-app is available in approved build. But after almost 48 hours "In Review" I got another rejection: We have returned your in-app purchase products to you as the required binary was not submitted. When you are ready to submit the binary, please resubmit the in-app purchase products with the binary. I have no idea how to submit "in-app purchase products with the binary". When preparing new version for review, there isn't any option to add the in-app as a single submission. Please help :/
1
0
1k
Feb ’23