Post

Replies

Boosts

Views

Activity

How can DeviceActivityMonitor extension communicate with my main app?
At 11:37 in this video - https://developer.apple.com/videos/play/wwdc2021/10123/ - Nolan instantiates MyModel() in swiftui view file. And then at 12:02 he just uses MyModel from extension. I have the exact same code and when I try to build my project, it fails with error that MyModel() could not be found. I shared my MyModel.swift file between extension target and main app. Now it builds. However, it seems there are two separate instances of MyModel. What is proper way for DeviceActivityMonitor extension to pass data to main app? I simply want to increment counter from extension every minute and let the main app to know that. Or even better, - is there a way to use SwiftData from Device Activity Monitor extension?
1
0
314
Feb ’24
view.familyActivityPicker shows only categories. No apps or websites.
As can be seen here, all categories are expanded but nothing under them: Not sure if related, but when I tried to upload my app for internal TestFlight testing I got following error: The code looks like this: @ObservedObject var model : MyModel @State var isPresented = false var body: some View { Button("select apps to discourage"){ isPresented = true }.onAppear { Task { do { try await AuthorizationCenter.shared.requestAuthorization(for: .child) } catch { } } }.familyActivityPicker(isPresented: $isPresented, selection: $model.selectionToDiscourage) } } Now I am wondering, is there one more thing that I need to do before familyActivityPicker would work? Here is what I have done: I subscribed to $99 Apple developer plan, Then I was finally able to see and add Family Controls capability under my Xcode project, Then I created Apple Family and logged in iphone (and simulator) as child. Then several days ago I submitted this form - https://developer.apple.com/contact/request/family-controls-distribution (not sure if this was mandatory for internal testing, but I have not received any communication from Apple - even confirmation for my request).
0
1
334
Dec ’23