Post

Replies

Boosts

Views

Activity

Reply to Reshield apps after certain time?
Are there any errors coming from the startMonitoring() call? There are limits on how short a time interval can be for a DeviceActivitySchedule; the minimum is 15 minutes, and the maximum is a week. If you're doing a two minute interval, you should be getting an intervalTooShort error. For my own app, when I want to unblock an app for a period of time, I use an interval that starts at the time the shield should be re-applied and ends when the primary schedule ends (or some time later, if that would be too short). Then I re-apply the shield on the intervalDidStart event.
Topic: App & System Services SubTopic: General Tags:
May ’25
Reply to How to get the bundleIdentifier or app name from FamilyActivitySelection's applicationTokens?
You can pass any of the tokens to the SwiftUI Label constructor to show the app name and/or icon.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’25
Reply to How to identify apps in FamilyActivitySelection?
The tokens conform to Codable, so you can use standard Codable functionality to read and write an encrypted representation of the tokens. To show the text and/or icon for a token, you can pass it to a Label view in SwiftUI.
Replies
Boosts
Views
Activity
May ’25
Reply to Reshield apps after certain time?
Are there any errors coming from the startMonitoring() call? There are limits on how short a time interval can be for a DeviceActivitySchedule; the minimum is 15 minutes, and the maximum is a week. If you're doing a two minute interval, you should be getting an intervalTooShort error. For my own app, when I want to unblock an app for a period of time, I use an interval that starts at the time the shield should be re-applied and ends when the primary schedule ends (or some time later, if that would be too short). Then I re-apply the shield on the intervalDidStart event.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’25