Posts

Post not yet marked as solved
3 Replies
1.2k Views
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?
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
3 Replies
900 Views
Hello, I have this widget: And as you can see down at the bottom, next item is very barely visible. This is because on different devices (combined with varied text sizes + number of lines) the vertical space differs quite a lot. In the past I had the limit set to 4 items in the bottom part but that often left empty space at the bottom or even overflowed still on iPhone SE. What is the proper way to tell ForEach (or any other component) to "layout as many items as can fully fit, but no more". The only solution I could think of is to use ViewThatFits and try first rendering 6 items, then 5 and so on to find the count that fully fits. But that seems maybe too complicated? Thanks.
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
0 Replies
219 Views
Please delete this, I made wrong conclussions. The issue wasn't with UISearchController as it is happening on other screens also where I dont even use the seach.
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
3 Replies
937 Views
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!
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
3 Replies
644 Views
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.
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
13 Replies
7.1k Views
Hello! I am playing around with the PHPickerViewController and so far I was able to get the selected images by loading them into UIImage instances but I don't know how to get the selected video. Below is the relevant implementation of the method: func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]): let provider = result.itemProvider guard provider.hasItemConformingToTypeIdentifier(AVFileType.mov.rawValue) else { return } &#9;&#9;&#9;&#9;&#9;&#9;provider.loadItem(forTypeIdentifier: AVFileType.mov.rawValue, options: nil) { (fileURL, error) in &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if let error = error { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;print(error) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;guard let videoURL = fileURL as? URL else { return } &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;DispatchQueue.main.async { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let fm = FileManager.default &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let destination = fm.temporaryDirectory.appendingPathComponent("video123.mov") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;try! fm.copyItem(at: videoURL, to: destination) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let playerVC = AVPlayerViewController() &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;playerVC.player = AVPlayer(url: destination) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;self.present(playerVC, animated: true, completion: nil) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;} I get crash trying to copy the item. It says the source file does not exists but the path looks real to me. "The file “3C2BCCBC-4474-491B-90C2-93DF848AADF5.mov” couldn’t be opened because there is no such file." I tried it without copying first and just passing the URL to AVPlayer but nothing would play. I am testing this on a simulator. Thanks for help!
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
0 Replies
528 Views
Hello, I am building contact form that allows to attach screenshots and screen recordings. The PhotosPicker part is relatively straightforward but I am not sure how to properly import the selected items. The binding is of type [PhotosPickerItem] which requires (at least for my current implementation) to first know if the item is image or video. I have this not so pretty code to detect if the item is video: let isVideo = item.supportedContentTypes.first(where: { $0.conforms(to: .video) }) != nil || item.supportedContentTypes.contains(.mpeg4Movie) Which for screen recordings seems to work only because I ask about .mpeg4Movie and then I have this struct: struct ScreenRecording: Transferable { let url: URL static var transferRepresentation: some TransferRepresentation { FileRepresentation(contentType: .mpeg4Movie) { video in SentTransferredFile(video.url) } importing: { received in let copy = URL.temporaryDirectory.appending(path: "\(UUID().uuidString).mp4") try FileManager.default.copyItem(at: received.file, to: copy) return Self.init(url: copy) } } } Notice here I have just the .mpeg4Movie content type, I couldn't get it to work with more generic ones like movie and I am afraid this implementation could soon break if the screen recordings change video format/codec. And finally my logic to load the item: if isVideo { if let movie = try? await item.loadTransferable(type: ScreenRecording.self) { viewModel.addVideoAttachment(movie) } } else { if let data = try? await item.loadTransferable(type: Data.self) { if let uiImage = UIImage(data: data) { viewModel.addScreenshotAttachment(uiImage) } } } I would like to make this more "future proof" and less error prone - particularly the screen recordings part. I don't even need the UIImage since I am saving the attachments as files, I just need to know if the attachment is screenshot or video and get its URL. Thanks!
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
9 Replies
1.7k Views
Hello, I initially started the discussion over at Swift Forums - https://forums.swift.org/t/issue-with-connect-proxy-some-connections-dont-work-probably-sockets/45575 because I am using SwiftNIO but it appears that it makes more sense here. I have an app with NetworkExtension of the packet tunnel provider type. So I am using the NEPacketTunnelProvider. As part of the extension, I have SwiftNIO server with connect proxy which is used to route the traffic. This works great in almost all cases, but apps like Signal or WhatsApp don't work. They don't display any kind of "no connection" indicator but the messages aren't send or received. Over at Swift Forums I got an answer from Quinn “The Eskimo!” that I think points to the actual problem: My experience is that a lot of these ‘chat’ apps explicitly bind their connections to the WWAN interface, which means they don’t use the default route and thus aren’t seen by the packet tunnel provider. My packet tunnel provider is configured to use the default routes for IP4 and IP6. So my concern is how to configure it, that it works also for the chat apps? There are couple of apps from the App Store that I tried which use this same approach and while they are active, Signal works fine. Yes, I know this solution is not ideal and not the main intended usecase for packet tunnel, but it is the only option available on iOS.. Thanks for help! Happy to clarify further.
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
Hello, I watched the EventKit session from WWDC 23 (https://developer.apple.com/videos/play/wwdc2023/10052/) that details the new permission changes. The ability to have just write access to the calendar is great, however my app also offers the user to view the already created event and to possibly edit it further via EKEventEditViewController. The event in question is release date of a videogame, so there might be needs for edit and based on saved event identifier, I am able to show different icon to let the user know that event exists. When the user taps on the icon, I use the eventStore.event(withIdentifier:. So I guess I will need the new "full access" with new prompt API to keep my functionality? Is there any possibility that this will change and apps would be able to query event they created? Thanks
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
5 Replies
966 Views
Hello, we have been using the SwiftUI Label with the Family Controls tokens (ApplicationToken, ActivityCategoryToken - https://developer.apple.com/documentation/swiftui/label/init(_:)-39rkz) And noticed that sometimes (quite rarely) the loading of the labels would take so long that it would freeze the entire app. Unfortunately as this only happened to our users (few times during user interviews) we aren't able to reproduce it on our devices and profile it. My guess is that this "mapping" of tokens to images happens entirely on the UI thread because it is supposed to be fast but sometimes there is huge delay and everything freezes. It would be great if the labels were somehow "prepared" on the background and the Label view would perhaps show some sort of loading and then get updated with the image of the app or category. This freezing was happening even when our app showed at most six labels on the screen. We tried some workarounds, namely to render the Label components in a backround and then use it as an image but instead of app icons we got yellow squares with red cross - probably due to privacy reasons. Anyone run into this issue? Any solutions?
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
0 Replies
444 Views
Hello, is this just me or does it seem lately that apps spend quite long time in "In Review" state? One of my work app has been "In Review" since April 20th, which is already 9 days. I have recently submitted minor update for my hobby app and it has been "In Review" for over 24 hours - while in the past it took just a couple of hours or even less to be approved. I understand that "Waiting for Review" can take time if there is long queue of apps but "In Review" this long? Surely the reviewer is not testing my app for 24 hours straight? Did they forget? Are they waiting for someone else to take a look? It just seems quite strange.
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
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 🙏
Posted
by nemecek_f.
Last updated
.
Post marked as solved
15 Replies
3.6k Views
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly. What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not. And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension. But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed. I am trying to create the device activity report without any filter which should give me all activity data per the docs. This is shown in the Xcode console for the view that uses DeviceActivityReport. 2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} 2022-06-17 18:08:47.219862+0200 DeviceActivityTest[9613:954204] [default] Attempt to map database failed: permission was denied. This attempt will not be retried. 2022-06-17 18:08:47.219911+0200 DeviceActivityTest[9613:954204] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} 2022-06-17 18:08:47.290070+0200 DeviceActivityTest[9613:954204] [default] Remote viewcontroller request failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}
Posted
by nemecek_f.
Last updated
.
Post marked as solved
9 Replies
3.4k Views
Hello, does anyone have any info/insight when we will be able to test app version that contains the Family Controls entitlement to TestFlight? iOS 16 is getting really close.. When we try to upload the build, Xcode shows the entitlements error and the Apple Developer portal shows that Family Controls is still available only for Development profile. Thanks!
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
1 Replies
758 Views
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 :/
Posted
by nemecek_f.
Last updated
.