Post

Replies

Boosts

Views

Activity

Reply to DeviceActivityReport - filtering applications for makeConfiguration
Hi there! Try this instead: let discouragedDuration = await data.flatMap { $0.activitySegments }.flatMap { $0.categories }.flatMap { $0.applications }.reduce(0, {$0 + $1.totalActivityDuration}) Not sure why this approach actually takes the filter into account, but my guess is that the filter doesn't apply as high up as the activitySegments level. Hope this works for you; it did for me.
Topic: App & System Services SubTopic: General Tags:
Aug ’23
Reply to Requesting authorization for self: FamilyControlsError code=3
var body: some Scene { WindowGroup { VStack{ ContentView() } .onAppear { Task { do { try await center.requestAuthorization(for: .individual) } catch { print("Failed to enroll with error: \(error.localizedDescription)") } } } } } This is the authorization code I am using.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to DeviceActivityReport - filtering applications for makeConfiguration
Hi there! Try this instead: let discouragedDuration = await data.flatMap { $0.activitySegments }.flatMap { $0.categories }.flatMap { $0.applications }.reduce(0, {$0 + $1.totalActivityDuration}) Not sure why this approach actually takes the filter into account, but my guess is that the filter doesn't apply as high up as the activitySegments level. Hope this works for you; it did for me.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’23