Posts

Post not yet marked as solved
2 Replies
206 Views
It seems that the first time I open my app after the phone is restarted, the app does not properly access UserDefaults. When my app is launched, I pull relevant user settings / preferences from UserDefaults. I recently noticed (after some users reached out about issues) that the first time the app is opened after a restart, the app appears as though all user settings / preferences have been erased. If the app is force quit and reopened, the user data seems to come back normally. If the user takes action in the app before force quitting, though, UserDefaults will be written to with these new, empty values (essentially erasing what used to be in UserDefaults). This makes it seem as though right after the phone is restarted, the app is unable to pull data from UserDefaults for some reason. Has anyone else seen this issue? It could also be due to the lifecycle of my app and how I access UserDefaults, so if others don't have this issue it would be great to hear how you handle this.
Posted Last updated
.
Post not yet marked as solved
2 Replies
264 Views
I use UserDefaults to store a variety of user data / preferences. Recently, I have started getting somewhat frequent complaints from users that their settings have been reset. There doesn't appear to be a rhyme or reason to the issue (some users have all of their data reset just once, while others are seeing that one of their settings resets very frequently). I haven't been able to pinpoint what the root cause is, but I figure that it must have something to do with UserDefaults (either all of it or only certain keys) somehow getting erased. As I figure out the root cause, I figure that a good solution in the meantime is to backup UserDefaults in some way (e.g. perhaps to iCloud?). Is there a standard / best-practice way of doing this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
449 Views
Is there a way for me to programmatically check whether a user has disabled my app's access to Screen Time? I currently request Family Controls / Screen Time access upon download by calling the following: AuthorizationCenter.shared.requestAuthorization(for: .individual) I need to be able to detect, though, when a user has gone into Settings -> Screen Time and disabled my app's Screen Time access. I tried calling the following: AuthorizationCenter.shared.authorizationStatus But it appears to have a value of Approved even after I turn off my app's Screen Time access. Is there any way to accurately detect this in the code?
Posted Last updated
.
Post not yet marked as solved
1 Replies
422 Views
If a user sets up a Shortcut to execute when the Settings app is opened, it will only trigger if the Settings app is opened from the home screen. If, though, the user opens settings through the Control Center (e.g. by holding down on Wi-Fi and tapping "Wi-Fi Settings..."), it will open the Settings app but not trigger the Shortcut. Is there any way to fix this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
506 Views
Our users report frequent crashes with the FamilyActivityPicker. Since this is a screen controlled by Apple, I'm assuming that there's nothing I can do to prevent these crashes. I'm wondering, though, if there's any way to gracefully handle these crashes? When this happens, the following is printed to the console: [com.apple.FamilyControls.ActivityPickerExtension(1121)] Connection to plugin invalidated while in use. Does anyone know how to handle/catch this error?
Posted Last updated
.
Post not yet marked as solved
1 Replies
430 Views
I have implemented an AppIntent in my app with the purpose of allowing users to set up an automation within the Shortcuts app that runs based on a boolean value in my app. It works well normally, but I've found that if my app is force quit, the Shortcut no longer works (presumably because it can't fetch the value of the boolean from my app anymore). Does anyone know how to persist this value so that the Shortcut will work regardless of whether my app is open in the background? Here is my implementation of the AppIntent: struct my_automation: AppIntent { static var title: LocalizedStringResource = "Automation Name" var isTrue = UserDefaults.standard.bool(forKey: "myVal") func perform() async throws -> some IntentResult { return .result(value: isTrue) } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
355 Views
If a user has Screen Time limits set up for certain apps, will that interfere with my app that allows users to restrict app usage using the Screen Time API? I've had some users experiencing this issue (they have Screen Time limits set up for apps, and my app isn't able to restrict those and/or other apps), but I haven't been able to find a reliable pattern yet. Has anyone else encountered this?
Posted Last updated
.
Post not yet marked as solved
0 Replies
380 Views
My app uses the ScreenTime API to allow users to block other apps. For some users, the FamilyActivityPicker doesn't render any apps, and they aren't able to block anything. When they go into Settings -> Screen Time, there is no section titled "Apps With Screen Time Access", and when they go into Settings -> , there is no toggle for Screen Time Restrictions - even though they enabled screen time access when setting up my app. Has anyone else seen this issue and/or resolved it?
Posted Last updated
.
Post not yet marked as solved
0 Replies
375 Views
Is there any way to show the user system apps in the FamilyActivityPicker? Specifically, I am asking about Safari. I am working on an app that allows users to block other apps, and I am trying to figure out whether I can make this functionality available for Safari.
Posted Last updated
.
Post not yet marked as solved
0 Replies
586 Views
The Screen Time API allows developers to block / shield all apps that aren't in the user's "Always Allowed" list in the Screen Time settings (by setting .all() for ShieldSettings.ActivityCategoryPolicy. What I've found, though, is that if an app is blocked, the user can simply go to this Always Allowed list, add that app, and it immediately becomes unblocked. I am trying to either prevent a user from being able to do this or detect when a user does this, as the point of an app like mine (that allows the user to block other apps) is to prevent people from easily accessing those apps that are blocked. Is this possible?
Posted Last updated
.
Post not yet marked as solved
1 Replies
911 Views
Is there any reliable way to persist some app data after the user deletes the app, so that the next time they download it again the data will still be accessible? For a variety of reasons, I do not currently want to require users to create accounts and then store that data on an external server - I am just storing all app data in UserDefaults. If a user deletes the app, though, it is important that if a user redownloads it certain datapoints would be accessible from the last time they used it. I have done a bit of research and it looks like Keychain can persist data after app deletion, but it seems like that might not be optimal (as it's meant more for things like passwords). Are there any other solutions I should try, or is it inevitable that I will need to require users to create accounts and then store this information in a backend I manage?
Posted Last updated
.
Post not yet marked as solved
1 Replies
542 Views
This may be a bit high level, but wanted some clarification as I can't be sure from reading the documentation. I am considering adding paid subscriptions into my app at some point in the future. Initially, though, I would like the app to simply be free to use. Even though I won't be charging subscriptions right away, would it make sense to implement the mechanics for subscriptions into the app right away for each user (and simply have the subscription be $0/month, for example)? Or will it be easy enough in the future to add the option for a paid subscription and integrate it seamlessly with existing users? To provide some additional context, I don't want to implement any sort of custom account creation / registration logic into my app (i.e. like on a social media where each user creates a username and password) - I would simply like to be able to utilize Apple's logic for Apple IDs and such to eventually handle payments and subscriptions. Is this something I should reconsider?
Posted Last updated
.
Post marked as solved
2 Replies
893 Views
I have a state in my app that is connected to a Live Activity. When the state is true, the Live Activity is active, and when it is false, the Live Activity is ended. I have noticed, though, that if a user starts the Live Activity (by changing the state to true), then force quits the app, then reopens the app and changes the state to false, the Live Activity is not ended / removed from the lock screen. Is there any way to fix this? Since there is no problem ending the Live Activity if the user doesn't force quit the app, it seems as though the Live Activity may be somehow connected to the specific instance of the app. Is there a way to not have the Live Activity connected to the only active instance of the app, but be able to have it ended by any future instance of the app?
Posted Last updated
.
Post marked as solved
2 Replies
660 Views
Within ManagedSettingsStore, in the documentation for the ShieldSettings.ActivityCategoryPolicy enum (here), one of the options is all(). It states that if this is used, the device will shield "all apps and websites". In practice, I have noticed that when this is used, a handful of apps (i.e. Messages, Maps) remain unblocked. Furthermore, it appears that on different devices, this usage results in different apps remaining unblocked (on my device Messages remained unblocked, but on another tester's device Messages was blocked). Can anyone provide clarification as to explicitly which apps are not included in the specification of "all()" and whether this changes based on device, iOS version, etc.?
Posted Last updated
.