Post

Replies

Boosts

Views

Activity

Reply to How to get BundleID from ApplicationToken?
I finally found a solution to your Problem. Instead of reading the AppIcon and AppName through the BundleID, you can retrieve it in a View using Label(selection.applicationTokens.first!).labelStyle(.titleAndIcon) You just need to get the applicationTokens and can retrieve the AppIcon and AppName through this Label. Hope this helps!
Topic: Code Signing SubTopic: General Tags:
Feb ’24
Reply to How to check app's Screen Time access?
For me using AuthorizationCenter.shared.authorizationStatus worked. In my View I'm displaying a Button to ask for Screentime-Access, if the user didn't already approve it, otherwhise I'm showing some settings. Here's, what worked for me: private var screentimeAccessButton: some View { Button("Screentime-Access") { Task { try await AuthorizationCenter.shared.requestAuthorization(for: .individual) // other handling } } } } private var screentimeSettings: some View { Section(L10n.commonScreentime) { if AuthorizationCenter.shared.authorizationStatus != .approved { screentimeAccessButton } else { // show other content } } } This worked, even when the user went into the settings and deactivated Screentime-Access. However, you still need to wait and maybe restart the app, until it has refreshed.
Topic: App & System Services SubTopic: General Tags:
Feb ’24