Post

Replies

Boosts

Views

Activity

Providing Pre-Selections to FamilyActivityPicker?
I am able to correctly select and store the tokens of apps and categories my users will block, but I am unable to pre-populate Picker whenever the app is rebooted with previously selected and stored tokens. Below is the selection variable I am passing to the picker... var selectionsToBlock = FamilyActivitySelection() { willSet { saveSelection(selection: newValue) blockersSelected = true } } Is there any way I can provide my existing blockers (shown below) so that the user can easily edit their list of restricted apps from the Picker? func savedBlockers() -> FamilyActivitySelection? { let defaults = UserDefaults.standard guard let data = defaults.data(forKey: userDefaultsKey) else { return nil } return try? decoder.decode( FamilyActivitySelection.self, from: data ) }
2
0
663
Dec ’23
Limiting / Blocking App Access to FamilyActivitySelection for 30 minute interval
Hello, I am able to have users properly select apps that my app can limit and block, however I am having a lot of trouble figuring out how to restrict access for set periods of times. For example, I want the user to select the apps they wish to block, store them so they can be reused later and whenever they press a button restrict access for the next 30 minutes. I understand this is doable if they are actively on the app, but I do not know how to automate the lifting of this restriction after the given period. Moreover, what is the best way to persist the category and application tokens selected via the FamilyActivitySelector?
0
0
457
Dec ’23