Posts

Post not yet marked as solved
3 Replies
290 Views
I'm working my way through adding passkey support to my app. At app launch, I'd like to test to see if the user has already created a passkey for the service, and if not, immediately present the account creation UI. Is there an API call I can make to see if the user already has a credential? From the examples I’ve found, it seems I should just try to sign in, and I’ll get an error callback if there are no stored credentials. Is that right?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
145 Views
I just started a little macOS app using SwiftUI and SwiftData. It seems to insist on placing the name of the file (along with the extension) in the title bar. I would prefer to put the name of the selection there instead (i.e. instead of "Untitled.paper", "New Article").. Along with that, I'd like to control the appearance of "Edited" as well. I have the suspicion that this simply isn't possible.
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
1 Replies
345 Views
It seems cross-device passkey authentication isn't supported by the Simulator, is that right? I can't tell if it's the simulator not supporting it, or my app/server failing. My app, running in the Simulator, presents a QR code during sign-in flow. I scan that with my phone, and it just spins "connecting…". Can anyone confirm that the Simulator just doesn't support this? What are my options for testing this flow? I guess I need another device not sign in to my AppleID.
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
117 Views
I would very much like to store some additional data in my SwiftData document package, outside of SwiftData. Metadata about the document that doesn't lend itself well to the underlying RDBMS nature of SwiftData. Is that possible?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
691 Views
I've got this SwiftPM project. It has a dependency that I needed to edit, so I forked it on github and checked it out locally. Then I referenced the local repo in the Package.swift file with package(path:) instead of package(url:). This caused it to report Package.swift: error: Missing package product 'WebAuthn' (in target 'App' from project 'server') I had to commit my changes, and re-reference the repo, to get it to see my updates. This problem has been around for some time, but seems to be related to how the path name differs from the built target name (it works fine in another project i have where the package directory and target have the same name). I've submitted FB13677717 about it, but is there a workaround?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
252 Views
I'm having an issue with logging on my system (Sonoma 14.3.1), in that log messages disappear after 60-90 seconds, despite logging being configured to persist. This seems to happen across all subsystems. The symptoms are: • Watching the log stream in Console.app, messages older than 60-90 seconds disappear, even if no new messages are coming in. • log show --last 2d only returns messages from the last couple of minutes. I've filed FB13616761, but wondered if anyone had any other insights or suggestions. TIA
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
1 Replies
245 Views
My app is a login item that gets registered as a background agent using SMAppService. On launch it checks to see that the user has an active subscription, and when I run it from Xcode, this works fine. But it seems that if I restart my machine and it is run from launchd right at login, StoreKit doesn't return any purchases. This results in my app throwing up a window to tell the user to subscribe. It’s hard to be sure this is the behavior, because I can't really use a debugger, and for whatever reason, OSLog is not persisting messages (despite being configured to do so). Does anyone know if it takes a while after restart or login for Store Kit to reliably return purchases?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
212 Views
How do I respond to a SpatialTapGesture in my RealityView when the tap is on no entity whatsoever? I tried just doing RealityView {} .gesture(SpatialTapGesture().onEnded { print("foo") }) but that doesn't get called. All I can find searching is advice to add Collision and Input components to entities, but I don't want this on an entity; I want it when the user is not looking at any specific entity.
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
296 Views
Because I can't find a way to share StoreKit purchases between two apps (macOS), I was forced to make my LSUIElement application a single app. This is turning out to work reasonably well, except for one issue that I hadn't noticed before (maybe it's new in 14.2?). The normal flow is this: User double-clicks app icon App calls SMAppService.agent(plistName: "com.myagent.plist").register(). The referenced plist points to the same application binary (see attached project) that the user launched in step 1. System launches a second instance of the application binary What I want the call to do instead is see that the app is already running, and just adopt it (that is, if it is killed or crashes, relaunch it). I see two inelegant workarounds: Wait until the user is done configuring the app after first launch, register the app and then quit. Thing is, I can't be sure when they're done, e.g. if they don't close the window. Allow both instances of the app to run, but quit if they close the window and it wasn't launched by launchd, or if there are other instances running. This feels fragile (e.g. if the behavior of register() is ever improved as I'd like). The best solution, of course, would be to share StoreKit context between apps, so I could separate this into the UI app and background agent. (To Apple: I've filed FB13574819 with my project attached.)
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
259 Views
In the abominable new commit line diff view, I have no idea what the colors mean. Some text is highlighted in a cream color, other text in purple. Googling just turns up people hating the view, as I do. I haven't found anything in the Xcode docs that explains the coloring. Looking at my files, I think cream is a deleted line and purple is added lines. Is that right? Light mode.
Posted
by JetForMe.
Last updated
.
Post marked as solved
2 Replies
357 Views
My app depends on the user granting Accessibility access (Allow this application to control your computer). There’s no formal permissions API (that I know of) for this, it just happens implicitly when I use the API for the first time. I get an error if the user hasn’t granted permission. If the user grants permission and I'm able to successfully register my CGEventTap (a modifier key event tap), but then later revokes it, key responsiveness goes awry. I don’t get any kind of error to my callback, but I do get tapDisabledByTimeout events periodically. I believe something is causing significant delays (but not preventing) in delivering events to my tap. Upon receiving this, I'm considering attempting to register another tap as a way to test permission, and disabling the real one if I no longer have permission. Does anyone have any better ideas? For Apple: see FB13533901.
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
366 Views
I wrote a StoreKit unit test and set the renewal rate to .oneRenewalEveryTwoSeconds for the test session. But now my App expires and renews every two seconds when running normally, even though the StoreKit Configuration file is set to "Real Time." Changing it to anything else doesn't change the renewal rate. I've tried cleaning the build folder. If, however, I set my SKTestSession explicitly to .realTime and run the test again, then my app behaves. However, again, it doesn't matter what I set the Configuration Settings to. Anyone know where this information is stored?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
234 Views
I've filed FB13497581 on this topic. But Ever since macOS 14 (or perhaps one of the releases that came after), my machine (M1 MacBook Pro) frequently locks up the UI. Sometimes it's so bad the mouse won't move. It only lasts a few seconds, but at its worst it happens every few seconds. It usually manifests as no text appearing as I type (which sucks, since I write code all day). I'm fairly certain configd is to blame. When this occurs, configd is using nearly 100% CPU, and spams logs with thousands of messages per second. Killing it does nothing. Rebooting might fix it for a bit, but it eventually comes back. I'm wondering if there’s some on-disk state I can **** away to start SystemConfiguration from scratch. I hate to do that in case someone from Apple asks me for files to analyze, but I feel like my FB is just going to languish. Meanwhile, this is rendering my machine unusable. Or if anyone knows how to interpret the log messages.
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
404 Views
My macOS SwiftUI app has a single Window scene. .onAppear() is called when it is created, but if it is closed, .onDisappear() is not called. How can I detect when the window is closed? Note, I need to distinguish between closed and inactive or background. scenePhase is not updated for the window or any of its subviews when the window is deactivated. controlPhase is, however. Note that my app delegate implements: func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return false }
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
359 Views
I’ve got some code that creates an AVPlayerItem from a URL, the creates an AVQueuePlayer from it. If I check the player item's status after that, it's still unknown. According to the docs, it'll remain unknown until it is associated with an AVPlayer, and then it "immediately begins enqueuing the item’s media and preparing it for playback." But checking the status right after that, I still get unknown, which tells me it’s not quite immediate. Is there any way to test if the player item will work immediately after creation? In this case, the problem is that my app doesn't have permission, due to it being a bookmark saved in a sandboxed app.
Posted
by JetForMe.
Last updated
.