Post

Replies

Boosts

Views

Activity

Issue with Parent selecting child's apps using Family Controls API
I'm trying to accomplish the features in this video where the child device requests permission from parent to control scren time. Then the parent can choose apps on the childs phone from their phone. Everything on the childs device is working exactly like in the video. However, on the parents phone, when the FamilyActivityPicker appears, it's only the apps on the parents phone and when an app is selected, nothing changes in the FamilyActivitySelection. I found this forum post describe the same issue I am having. I have a physical device logged in the child and a simulator running as the parent. Why can't I see the child's apps on the parents phone? Is it cause I'm running one of them on a simulator?
0
0
77
3d
FamilyActivitySelection sharing between device in Family Sharing Network
I'm working with the FamilyControls API and am running into an issue with sharing ActivityTokens between devices in the same family sharing network. Based on this documentation, ActivityTokens are only accessible and readable by other members in the family sharing network. My app is based on the idea that if one user selects the Games category in the FamilyActivityPicker, then this token can be shared with another device in the same family-sharing network and this other device can read and display the category. So my question is: If a user in the network selects an activity category in the FamilyActivityPicker, can this category token be shared, read, and used by another user in the family-sharing network?
1
0
120
2w
FamilyActivitySelection tokens are invalid for other members in family sharing network
I'm currently working with the FamilyControls API and testing my app on two different devices. Both apps are in the same family-sharing network with one phone being the owner of the network (I'll call this A) and the other one being an adult in the network(I'll call this B). When device A picks apps using the FamilyActivityPicker, it shares that selection with device B (via encoding, sending over network, and decoding on device B). However, interacting with the token (displaying it, using it in shield) throws an error saying the token is null. From the documentation, I thought every token would be the same across all devices in the family sharing network. So my question: How do I send the FamilyActivitySelection from A to B and have the tokens still be functional? Does this functionality only work if A is a "parent" and B is a "child" in the family sharing network? Also, side note: If I reverse the process and send the tokens from B to A. Interacting with the token works exactly as expected. For some reason, it's only going from A to B where it doesn't work.
0
0
155
3w
How to pass Child Class reference as Parent Class
So I have this child class with a function that creates a perdetermined array of other classes. class DirectGame : GameParent { static func GetAllChallenges() -> Array<ChallengeParent>{ return [LockdownChallenge(game: self)] } } These other classes take in a GameParent class in the initalizer like so: class LockdownChallenge { var game : GameParent init(game: GameParent) { self.game = game } } However this line return [LockdownChallenge(game: self)] is throwing the error "Cannot convert value of type 'DirectGame.Type' to expected argument type 'GameParent'" How do I pass in a reference to DirectGame into the initalizer of ChallengeParent?
2
0
367
Aug ’24
Application Tokens from Bundle Identifier
Hello! I've been doing a lot of work with ApplicationTokens, but there is very little documentation. While Apple gives you the FamilyAcitvitiesPicker to get tokens of apps on an iPhone, I need to get the tokens of apps that aren't on the phone. Example: Someone can select Instagram even though they don't have it downloaded. Then the application token will get sent to a server. Then a different person who does have Instagram on their phone will receive the token and it will do something with that application. Because FamilyActivitiesPicker can only select apps on the iPhone that it is running on, FamilyActivitiesPicker is useless to me, leading to my problem: Creating an ApplicationToken without FamilyActivitiesPicker This documentation says that I can create an Application (and thus an ApplicationToken) from the bundle identifier init(bundleIdentifier: String) Creates an object that represents the app with the specified bundle identifier. However, when I try to use this to get instagrams(or any apps) token, it returns nil every time! So, finally, my questions: How do I correctly use this initializer to create an ApplicationToken? Or, if this won't work for my purposes Are the ApplicationTokens created by FamilyActivitiesPicker the same across all devices no matter what?
2
0
606
Aug ’24
Creating ApplicationToken with Decoder from string
I've been working a lot with the FamilyControls API and App Shield recently but have encountered a problem with no documentation. I used the FamilyActivitySelection to select the app store to shield(This is just for testing), and then printed out the application token: 1wfY¸êB ò S« öi #×(É?âðw ù/jQ ¿ J ïE¢? ·¿ º<Òd?ý r7¥Ãn N átJ¹ÿ85B_{VAF fC8. ,,¸¯3 T7F ±õü; ¹?v@¯ô Ä \-õ# Ò I know the application token is a Codable object so I was wondering, How do I create an application token using the Token<Application> initializer init(from: any Decoder) throws Creates a new instance by decoding from the given decoder. Using the above data? Do I have to encode first in order to decode it? For reference, the code I tried to use is: newValue.applicationTokens.encode(to: JSONEncoder) if let encoded = try? JSONEncoder().encode(newValue.applicationTokens) { data = encoded print(String(data: data, encoding: .utf8)!) } if let app = try? JSONDecoder().decode(Token<Application>.self, from: data) { let token = Application(token: app) print(token) } else { print("didn't work") } But it prints didn't work every time. What should I do differently?
1
0
398
Aug ’24
How to get which app is currently being used by user
Hello! I'm designing an app that tracks users' screen time and shares it with each other. I've looked extensively into the ScreenTimeAPI and it seems as if Apple doesn't allow any way to share screen time data. Even with the user's permission. I was wondering whether there is a way that my app (running in the background) would be able to get whether the user was currently using the notes app (or any other app). I was looking into the AppTrackingTransparency framework to see if this functionality was at all possible, but came up short of finding an answer. Is this possible? My guess is no but still wanted to check.
1
0
482
Jul ’24