Post

Replies

Boosts

Views

Activity

Device Activity Event | Screen Time API features iOS 16
Hi there! In my previous question I received the answer that we can use DeviceActivityEvent for remote control with .individual auth. Here I'd like to clarify: Is there any restrictions to use remote control for .individual if we compare it with .child? Is it possible to add/set/update restrictions remotely with DeviceActivityEvent API for .individual? Thank you!
1
0
1.3k
Oct ’22
ManagedSettingsStore is empty in DeviceActivityMonitor
I'm following the video with explanation of how to dealing with DeviceActivityMonitor extension. I'm facing the issue with empty ManagedSettingsStore when I'm trying to retrieve discouraged apps. The apps successfully where blocked on the selection step via .familyActivityPicker. The problem is that I can’t retrieve discouraged apps. I read that Model.shared won’t work in extension. To sync an app and extension we need to use AppGroups. Do we need to use AppGroups if we follow code like in the video?
3
1
986
Jan ’23
Decode/Encode ApplicationToken | Screen Time API features iOS 16
How I can decode ApplicationToken which I receive from FamilyActivitySelection? I've been expecting String type or ability to extract String from ApplicationToken. My goal is switching between user's modes, where one device could be used for Parent and Child. For this case I'd like to keep ManagedSettingsStore() setups for each user.
4
1
1.8k
Jan ’23
FamilyActivitySelection | Screen Time API features iOS 16
How to store at one time more than one app while selection from FamilyActivityPicker? .familyActivityPicker( isPresented: $isDiscouragedPresented,     selection: $model.selectionToDiscourage ) The code above save only one token. If user select more than one app the FamilyActivitySelection.applicationTokens becomes empty [], but if select only one app, applicationTokens will contain one token from selected app.
4
0
1.7k
Feb ’23
Get Set<ApplicationToken> after shielded apps trough applicationCategories .all
To shield all app except a few, I did the next: store.shield.applicationCategories = .all(except: exceptions) After code above I can see that apps were successfully shielded. Then I need to receive all app's tokens that were shielded on the previous step. To achieve that I do the next: let applicationTokens = store.shield.applications But always receive nil! What should I do to get set of shielded apps which were blocked by applicationCategories?
2
1
1.3k
Mar ’23
Interact with ManagedSettingsStore from DeviceActivityMonitor
I want to remove shield restrictions for apps. Following the WWDC21 video, I declare ManagedSettingsStore and trying to reset restrictions: class MyDeviceActivityMonitor: DeviceActivityMonitor { let store = ManagedSettingsStore()       public override func intervalDidEnd(for activity: DeviceActivityName) {      super.intervalDidEnd(for: activity)            store.shield.applications = nil    }  } Will this string has impact on the app store.shield.applications = nil? Because now, while testing it seems that I'm dealing with two different stores. Or again it is doesn’t synced by default and let store = ManagedSettingsStore() will create store which will be different than store on which the app is relays on? Thank you!
2
0
1.9k
Mar ’23
ManagedSettings applicationCategories to applications
I have next flow: User selects apps to discourage Then user selects apps with permanent access. To do this, the app blocks all apps, and then user selects which apps should be unblocked back. I've created two ManagedSettingsStores. At the step 1, I put apps in store 1, at the step 2 I put apps in store 2. To block all apps at step 2 I do: store.shield.applicationCategories = .all() After that I'm expecting that store.shield.applications will contain all apps that user has blocked at the step 2. I want to filter blocked apps on step 1 and step 2. But it doesn’t happen. Instead I see just one general token for all blocked apps. How I can receive Set<ApplicationToken> from ShieldSettings.ActivityCategoryPolicy<Application>?
2
1
2.5k
Mar ’23
Can we send Local Push Notifications from DeviceActivityMonitor extension?
I'm wondering if we able to send Local Push Notifications from DeviceActivityMonitor extension... If we have to use AppGroups to pass info between an app and the extension, could we post notification though UNNotificationRequest? I also tried to push data through NotificationCenter, also doesn’t work. Can we do so, or did something wrong? Should these cases that I described above work from iOS 16 and above or not? Thank you!
2
0
1.2k
Mar ’23
DeviceActivityMonitor Extension methods not being triggered
I did a lot of researches, but cannot understand why methods inside DeviceActivityMonitor extension are not calling. What I've seen related to this question and already checked: Do you starting monitoring for schedules? Yes, I do by calling center.startMonitoring() as it has been explained on WWDC2021-10123. I was searching an issue while creating the extension. Walk through steps that are described here. Everything looks good for me. Did you add Family Control Capability to extension's target? Yes, I did. Is your device authorized with FamilyControls? Yes. The only doubt I have here that I'm authorising FamilyControls for .individual . But as I've asked previously, it shouldn’t be a reason. Task {       do {         guard #available(iOS 16.0, *) else {           // Fallback on earlier versions           return         }                   try await AuthorizationCenter.shared.requestAuthorization(for: .individual)                   switch AuthorizationCenter.shared.authorizationStatus {         case .notDetermined:           print("not determined")         case .denied:           print("denied")         case .approved:           print("approved")         @unknown default:           break         }                 } catch {         print("Error for Family Controls: (error)", error.localizedDescription)       }     } -- So, what could I have missed? Also, should I see bundles of app and extension in Xcode -> Debug -> Attach to Process -> ... or I have to add them to see logs in Console app?
10
1
2.4k
Apr ’23