Post

Replies

Boosts

Views

Activity

Reply to List of Apps selected from Family Activity Picker from a parent/guardian device is empty
Hi  MohamediOS! You get an empty set of applications tokens because the parent app is not authorized and you can't get it authorized at all. I think that apple did this from security issues and you can see this even on an authorized child that the applications tokens set is not empty but it's encrypted. So i believe you can't get this list on a Non authorized app at this moment maybe apple will be nice and make an api change that we can retrieve this information on a connected users threw the family sharing or something.
Mar ’22
Reply to Can I manage restrictions from the parent's application?
From what i saw you can't get the neither the application identifiers nor the application tokens of the applications on the parent device' probably because security and information privacy issues. Let's remember that you also can't get authorization on parent app. I may have a possible solution for this but i haven't tried it yet to see if it works: Sending selection model from the picker via server to the child app and use it on the picker. Probably it won't work because of encryption and security issues but it worth the try. Let me know if it helped
Jan ’22
Reply to Event threshold callbacks are inconsistent
first of all i assume you are talking about shielding apps. when i tried to trigger the threshold callbacks i noticed that the threshold i defined was reached not by one app i selected but as a sum of the usage of all the apps i selected. maybe start from there? if you defined an DeviceActivityEvent with a threshold of X and passed several applications, it means that if the total usage for all the apps combined is X than the callback will fire if you want each app to have different threshold consider creating DeviceActivityEvent for each app separately tell me if it was helpful for you
Jan ’22
Reply to FamilyControls DeviceActivityMonitor extension can't change shields
."But even if I try only setting the restricted apps to nil or the empty set the apps remain shielded until I run the same code from the main app." - you need to remember that app and an app extension doesn't share data so it's likely that the store instance you are using isn't the same. what you need to do is to manage the selected apps list you want to shield or block using user defaults or core data or some other persistence storage that will be shared between your app and app extension. and block or unblock according to the data you are managing between them. try to keep the blocking or unblocking on the app or on the app extension so only one of the will use the store. i chose to do this on the extension using the events that correspond with start and stop monitoring
Jan ’22
Reply to How does child can unblock apps for some period of time using Screen Time API?
what your code actually says is: after 30 seconds of total usage of the application that you selected (applications.applicationTokens) the "eventDidReachThreshold" of the DeviceActivityMonitor extension will be called. handle your event ".encouraged" inside the "eventDidReachThreshold" and do there what ever you like. i think for you case if you want to limit some apps for a period of time just make a scheduled event that start from the current time you tapped an OK button (or some other action) to current time + limitation time of tour choice. and on your DeviceActivityMonitor extension you should handle the blocking and unblocking on the intervalDidStart and intervalDidEnd the your code should look something like this:   do {       let schedule = DeviceActivitySchedule(intervalStart: start, intervalEnd: end, repeats: false, warningTime: nil)            try center.startMonitoring(.block, during: schedule)           } catch {       print("error: " + error.localizedDescription)     }
Jan ’22
Reply to Screen Time Guardian App Questions
if you set the family correctly the app that the child have should be presented on the picker on the parent i have a parent with iOS 15.0.2 and a child with iOS 15.1 and it seems to work (sort of) i have to mentioned that the facebook app is an app i downloaded after using the screen time api on my app and this require a confirmation from the parent app i did not managed to block or shield an app from the parent on the child because an authorization error i'm keep getting i don't know why the icon of the app is missing on the child app child: parent:
Nov ’21
Reply to Is the Screen Time API completely broken in the betas?
i have created an extension and changed the identifier to com.apple.deviceactivity.monitor-extension i subclassed DeviceActivityMonitor in my class and designated it as the principal class of my app extension but non of the methods doesn't get called when trying to monitor an activity what method will trigger the extension? is it center.startMonitoring(activity, during: schedule) in that case why non of my extension DeviceActivityMonitor methods doesn't gets called? why calling requestAuthorization on parent device always fails? can anyone upload some sample code that actually do something?
Aug ’21