Posts

Post marked as solved
2 Replies
1.1k Views
There is frequently a delay of a few seconds before a DeviceActivityReport renders its view generated from the DeviceActivityReportExtension. It will also sometimes flash with zero data before hydrating with the real activity data (tested with extension code taken directly from XCode boilerplate) Is there a way to be notified when the DeviceActivityReport renders successfully or is still processing, i.e. so a loading indicator can be presented while the extension runs? Thanks!
Posted
by foijodsf.
Last updated
.
Post marked as solved
2 Replies
1.4k Views
DeviceActivityReport does not seem to re-render properly when a subview is popped off of a NavigationStack. The following code (with the extension code generated directly from XCode boilerplate) renders the device activity report when the app loads, but after the button is pressed and the new subview is dismissed, the device activity view becomes blank. I don't see the same behavior with a modal like .sheet(). XCode 14.2 (14C18), iOS 16.3 beta (20D5035i) import SwiftUI import DeviceActivity extension DeviceActivityReport.Context {   static let totalActivity = Self("Total Activity") } struct OtherContentView: View {   var body: some View {     VStack {}   } } struct ContentView: View {   let context: DeviceActivityReport.Context = .totalActivity   let filter = DeviceActivityFilter(     segment:.daily(       during: DateInterval(         start: Date().addingTimeInterval(-24 * 3600),         end: Date()       )     )   )       var body: some View {     NavigationStack {       List {         NavigationLink(destination: {           OtherContentView()         }, label: {           Text("Press Me")         })         DeviceActivityReport(context, filter:filter)           .frame(maxWidth: .infinity, minHeight: 250.0)       }     }   } } If I put the report below the List, like so...    var body: some View {     NavigationStack {       List {         NavigationLink(destination: {           OtherContentView()         }, label: {           Text("Press Me")         })       }       DeviceActivityReport(context, filter:filter)         .frame(maxWidth: .infinity, minHeight: 250.0)     } ...the report still shows after popping the subview from the navigation stack, but then after a few seconds it becomes blank with the following error reported in XCode terminal: [default] VS terminated with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
Posted
by foijodsf.
Last updated
.
Post not yet marked as solved
1 Replies
733 Views
Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.) I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug? Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time. Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs. Thanks!
Posted
by foijodsf.
Last updated
.
Post not yet marked as solved
4 Replies
2.7k Views
Hi, I am interested in decoding multichannel Higher-Order Ambisonics feeds to the Spatial Audio renderer discussed in the "Immerse your app in spatial audio" WWDC21 talk. However, I could not find any documentation about which multichannel audio formats are actually supported by the renderer, and a search for "Ambisonics" in the developer documentation only contains results pertaining to the Audio DriverKit. Can someone please enlighten me? Thank you!
Posted
by foijodsf.
Last updated
.