This is more a general question of whether it is possible to share persistent/coredata from the main app to Screentime-related extensions such as DeviceActivityReportExtension.
I've set my code up (e.g., App Groups, files to different targets, using nspersistentcontainer with app group url, etc.) in a way that it builds, and the extension seems to recognize my CoreData schema (able to query using fetchrequest). But the data returned is always null. So i'm wondering if it is even possible to READ app data from the extension.
I understand it is not possible to write or pass data from the extension back to the app. I've also been able to read data that was saved in main app from UserDefaults in my extension.
General
RSS for tagDelve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, I'm in the process of creating an App + Helper Tool combo application, and depending on the necessity of root privileges, I'm setting up two paths in the app:
If root privileges are not necessary, I'm using SMJobSubmit rather directly:
var submissionError: Unmanaged<CFError>?
let submissionResult = SMJobSubmit(kSMDomainUserLaunchd, plist, nil, &submissionError)
where plist contains these items:
Label=com.***.redactedApp.redacted,
ProgramArguments=[path/to/helper-tool, commandName, commandArg1, commandArg2]
RunAtLoad=1,
KeepAlive=0
and it works as necessary, and performs the operations.
Now, in the case of privilege escalation being necessary, this call becomes a bit more complex:
let authorization = SFAuthorization()
var authRef: AuthorizationRef?
do {
try authorization?.obtain(withRight: kSMRightModifySystemDaemons,
flags: [.extendRights, .interactionAllowed])
authRef = authorization?.authorizationRef()
} catch let error {
// Logging error
}
var submissionError: Unmanaged<CFError>?
let submissionResult = SMJobSubmit(kSMDomainSystemLaunchd, plist, authRef, &submissionError)
while using the same plist, same executable at the same path, same Label.
However, when using the second path, suddenly SMJobSubmit fails:
Error Domain=CFErrorDomainLaunchd Code=2 "(null)"
Now, naturally I headed over to system logs in Console.app, and this is the weirdest - there is nothing suspicious near the log item I submit with the above error from the main application.
The tool is embedded in the Contents/MacOS folder. However, my problem is that anything that I can think of seems to lead to the same thought: it should be a problem in both cases, not just the privileged one.
Is there something extra that must be taken care of when using SMJobSubmit with privileged helper tools?
Hi,
I have a question about On-Demand Resources, I tried to put some bundles into the Initial Install Tags and Download Only On Demand, and I uploaded the build to TestFlight, then I tried to make 2 builds, and the sample is like this:
Build A:
Initial Install Tags have 100 Tags.
Download Only On Demand have 5 Tags.
Build B:
all contents of Initial Install Tags are the same as in Build A.
Download Only On Demand are the same as Build A but I added 5 more tags, so the total is 10 tags, 5 tags that are the same as Build A and 5 new tags.
Then I tried to download Build A for the first time which is in TestFlight, and it runs normally, Initial Install Tags are downloaded when the main app is downloaded and Download Only On Demand is downloaded when I request the tag.
However, when I tried to update to Build B which is in TestFlight, why are the Initial Install Tags deleted? and why should it be downloaded via request? not when the main app is downloaded? has anyone ever experienced something like this?
Thanks!
I have been using the hourly weather forecast API, for some reason sometimes the API fails with 400 Bad Request, but on retrying just a minute later the call successfully returns data. The start and end time are 2 days apart so I don't think it's an issue with the time frame.
The failed calls also don't return any reason so not sure what is the exact failure.
Has anyone encountered this issue or knows why this might be happening??
Thanks!!
My app is available in TestFlight but has been rejected in App Review with the review feedback that the app clip "just shows a blank screen".
However, in the TestFlight app, the App Clip works as expected and brings up the clip. It also works correctly from Xcode testing.
Any ideas on what the problem could be? It is using the default App Clip link (appclip.apple.com)
Hi,
I’m trying to get an array of strings from the user using AppIntents, but I’m encountering an issue. The shortcut ends without prompting the user for input or saving the value, though it doesn’t crash. I need to get the user to input multiple tasks in an array, but the current approach isn’t working as expected.
Here’s the current method I’m using:
// Short code snippet showing the current method
private func collectTasks() async throws -> [String] {
var collectedTasks: [String] = tasks ?? []
while true {
if !collectedTasks.isEmpty {
let addMore = try await $input.requestConfirmation("Would you like to add another task?")
if !addMore {
break
}
}
let newTask = try await $input.requestValue("Please enter a task:")
collectedTasks.append(newTask)
}
return collectedTasks
}
The Call
func perform() async throws -> some IntentResult {
let finalTasks = try await collectTasks()
// Some more Code
}
Any advice or suggestions would be appreciated. Thanks in advance!
I've been stuck for days trying to figure out how to extract the full text of a Siri prompt that launches my app. We need to be able to get the text of the full command, such as "Hey siri, buy dogfood...." so I can get "dogfood" or anything else following 'buy' . The examples I am finding are a) out of date or b) incomplelete. Right now we're using AppIntents with Shortcuts, but have to use dedicated shortcuts for each specific purchase, which are obviously very limiting.
Hi all,
From what I’ve seen on forums and other sources, it appears that nothing can be done to set the contact poster programmatically. Setting the imageData property affects only the thumbnail image. Does anyone know if this is explicitly documented somewhere? I need this information for a POC document. I watched the iOS 17 keynote (where it was introduced), the Platform State of Union, and other WWDC videos, but I couldn’t find any mention of it. The Contacts framework documentation only explains what can be retrieved from this property and doesn’t mention any way to set the contact poster.
If anyone has any information on this, please help!
Thanks in advance!
We have received user reports indicating that, while using our app for meetings, they occasionally encounter system unresponsiveness, ultimately leading to an unexpected black screen and system restart.
Our app's internal logs show normal operation during these incidents.
To assist in diagnosing the issue, we have collected system logs (WindowServer.ips) from affected users.
We would appreciate your assistance in analyzing these logs to help identify the root cause of the problem.
Thank you for your support and assistance.
Topic:
App & System Services
SubTopic:
General
right now it looks like the app type must follow the guidelines like Messenger app, Navigate app, and Music app only. What about the Automotive app itself, What is the flexibility of it?
We have an app for service cars for one brand (officially)(car users around 1m+). but we looking to merge the experience between outside the car and inside the car. Can we top up some features on the app to share some information that is a part of the car like trip calculation or car info display on the screen? or services time to notice them?
And following that question can we know about the exact spot or brief from Apple car play for now and next-gen?
Or can we work with your team closely as a partner? to make things happen and develop it to be a flagship product, we can share some data and talk about it with real insight.
I'm trying to use ScreenCaptureKit on a Mac Catalyst app, on macOS 12.5.1.
I'm not sure if I'm doing something wrong, but it crashes as soon as I try to request SCShareableContent. It crashes on internal code, calling a method it can't find, which makes me think this is a bug in the framework rather than incorrect configuration.
Any hints on how to work around this problem?
The crash is:
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RPDaemonProxy fetchShareableContentWithOption:windowID:withCompletionHandler:]: unrecognized selector sent to instance 0x6000037d5dc0'
terminating with uncaught exception of type NSException
ScreenCaptureKit-Crash.txt
Topic:
App & System Services
SubTopic:
General
Tags:
Mac Catalyst
ReplayKit
ScreenCaptureKit
wwdc2022-10155
Currently, I am working on an iOS app with a Deployment Target set to iOS 15.0, and macOS 12.0. The app is allowed to run on Macs with Apple Silicon.
A customer with a Mac running macOS Monterey (12) is complaining that in the TestFlight app, they cannot install the app since it shows "Requires OS Update", even though the deployment target is smaller than the installed version of macOS 12.
Are there any specifications available on which macOS version is required in order to use iOS apps on Silicon Macs?
I have an iOS app that installs a Content Filter in order to block certain types of content at the network/socket level. The Family Controls framework stipulates that this can only be done successfully on a FamilyControlsMember.child account type (or on a supervised device). Our initial release has been really successful, but I would say that perhaps 75% of our users are .individual (probably over 18). Perhaps a topic for another forum post is to discuss how Apple's policy here doesn't seem to be meeting a real need here for non-minors, but I'll leave that alone for now.
The problem we're facing is that as far as I can tell, the only way to determine if someone has the right account type is to initiate an authorization request using AuthorizationCenter.shared.requestAuthorization(for:) and then inspect the error. I think it could really help the usability of the app if we could detect the account type and preemptively show a helpful message if the authorization could not succeed, and recommend some alternatives. But I've looked so far in vain for some way to do this.
Is there any api in Family Controls (or elsewhere) that can query the system for this information? Any pointers would be greatly appreciated!
I am trying to return a SceneView from a DeviceActivityReport. I have my DeviceActivityReportExtension correctly set up and I am able to display a view with text or other UI elements in it, but attempting to return a SceneView as part of the body just won't display. I have this example. When I display this SceneView in my main app, it displays correctly. When I put the same code inside the DeviceActivityReportExtension, the scene does not show up and an error failed to create a gl context appears repeatedly in the console. I'm pretty stumped and would appreciate any suggestions.
import SwiftUI
import SceneKit
struct TestScene: View {
var scene: SCNScene? {
SCNScene(named: "art.scnassets/environment.scn")
}
var cameraNode: SCNNode? {
let cameraNode = SCNNode()
cameraNode.camera = SCNCamera()
cameraNode.position = SCNVector3(x: 0, y: 0, z: 2)
return cameraNode
}
var body: some View {
SceneView(
scene: scene,
pointOfView: cameraNode,
options: [
.allowsCameraControl,
.autoenablesDefaultLighting,
.temporalAntialiasingEnabled
]
)
}
}
Hi everyone,
I'm working on an app for parents and kids where parents can define screen time goals or restrict usage of certain app categories (like social media or games). If the kid follows those rules—for example, by using their device less or avoiding restricted categories—they would earn points or rewards in the app.
I’ve been exploring if the Apple Screen Time API allows developers to access this kind of data (like total screen time, app usage by category, etc.) so that I can track the kid’s behavior and reward them accordingly.
Is it possible to programmatically access this data and implement such a reward system within my app? If so, what’s the best way to get started or which APIs should I look into?
Thanks in advance for your help!
Hi All, I would like to develop a small macOS app using swift. I want to use ImageCaptureCore to access and control connected scanners ( via usb). I followed the official docs and wrote this ScannerManager. The code seems to be working without issues or warnings.
I added the Hardened Runtime capability and both com.apple.security.personal-information.photos-library and com.apple.security.device.usb to the .entitlements file.
As well added NSCameraUsageDescription to the Info.plist.
Problem:
None of my scanners do get detected (tested 2 different models). Of course, they are connected and do get recognized by the Image Capture App (and work as expected) and are listed in the systems app, too.
When I connect my phone it does get detected by the
func deviceBrowser(_ browser: ICDeviceBrowser, didAdd...
delegate function. Thats why I believe my code is working but the app is lacking permissions to detect scanners somehow. Does anyone know something about this?
I am using macOS 15.1.1 (24B91) on a M1 Pro.
Many thanks in advance!
class ScannerManager: NSObject, ICDeviceBrowserDelegate, ICDeviceDelegate {
let deviceBrowser: ICDeviceBrowser
private var currentDevice: ICDevice?
private var scannerDeviceDelegate: ScannerDeviceDelegate?
var isScanning = false
var scanners: [ICDevice] = []
// MARK: - Initialization
override init() {
print("🚀 Initializing ScannerManager...")
self.deviceBrowser = ICDeviceBrowser()
super.init()
self.deviceBrowser.delegate = self
// Log the initial browsed device type mask
self.deviceBrowser.browsedDeviceTypeMask = .scanner
print("🔍 Starting device browser...")
self.deviceBrowser.start()
// Enhanced device logging
if let devices = deviceBrowser.devices {
print("\n📱 Connected devices overview:")
print("Total devices found: \(devices.count)")
if devices.isEmpty {
print("⚠️ No devices currently connected")
} else {
devices.forEach { device in
print("\n📌 Device Details:")
print(" - Name: \(device.name ?? "unnamed")")
print(" - Type: \(String(describing: device.type))")
print(" - Transport Type: \(String(describing: device.transportType))")
print(" - Status: \(device.hasOpenSession ? "In Use" : "Available")")
print(" - Persistent ID: \(String(describing: device.persistentIDString))")
print(" - Location: \(device.locationDescription ?? "Unknown")")
print(" - Capabilities: \(String(describing: device.capabilities))")
}
}
} else {
print("⚠️ Unable to access device list")
}
}
...
Topic:
App & System Services
SubTopic:
General
I recently tried Apple TV after using android tv for a long time.
The main missing item is having a browser. I could not find one.
i tried building Firefox for TVOS, it failed with WebKit not available.
Is there a way to build WebKit and package it along with a browser package while building it?
I'm using react native with expo, firebase for auth, and I have google, facebook and Apple Sign In enabled. On my IOS simulator I can sign in using all 3 with no problems, but when I build and submit to test flight and test on a real device only google sign in works
It crashes when I try to sign in with facebook and I get an error saying The operation couldn't be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
Topic:
App & System Services
SubTopic:
General
I'm unable to have stickers show in messages even with a new iOS app and a sticker pack extension target.
I do see the iMessage App Icon but after tapping it nothing shows and I see a warning: "Error creating the CFMessagePort needed to communicate with PPT"
This was tested on simulator and on real device.
Xcode 16.1 (16B40)
iOS 18.1 & 18.2
In the mobile application we are developing we need to use the "SMS and MMS Message Filtering" functionality to analyze SMS messages received from unknown senders.
The questions that arise about the use of this functionality are:
Does this functionality allow these messages to be sent to solutions deployed in Microsoft Azure?.
If the previous case is confirmed, could we use Rest APIs that we already have deployed in Azure?.
If it were not possible to configure access to an existing Rest API, what would be the definition of the API to be implemented in the cloud for this service?.
And finally, how would the configuration of access permissions to this API deployed in the cloud be?.