Post

Replies

Boosts

Views

Activity

Trouble with AppleScript Permissions and ShazamKit Integration in macOS App
Hello fellow developers, I am developing a macOS app called "Playlist Plunderer 2," aimed at using AppleScript to control the Music app to play songs and employing ShazamKit to recognize these songs and update their metadata. Despite setting up the entitlements and plist files correctly, I'm encountering issues with gaining the necessary AppleScript permissions, and my app is not appearing under 'Automation' in System Preferences. Additionally, ShazamKit fails to match songs, consistently returning error 201. Here are the specifics of my setup and what I've tried so far: Xcode Version: 15.4, macOS 14.1.2 Entitlements Configured: Includes permissions for Apple events, audio input, and scripting targets for the Music app. Capabilities: ShazamKit and ScriptingBridge frameworks integrated, set to "Do Not Embed." Info.plist Adjustments: Added "Privacy - Microphone Usage Description." Scripting: Manual AppleScript commands outside of Xcode succeed, but the app's scripts do not trigger. Entitlements File: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.automation.apple-events</key> <true/> <key>com.apple.security.device.audio-input</key> <true/> <key>com.apple.security.files.user-selected.read-only</key> <true/> <key>com.apple.security.scripting-targets</key> <dict> <key>com.apple.Music</key> <array> <string>com.apple.Music.playback</string> <string>com.apple.Music.library.read-write</string> </array> </dict> </dict> </plist> I am having issues controlling the music app (itunes) from the apple script within my xcode project. the objective of the app is to rewrite the metadata of songs inside a folder in my Music app, this folder is titled Playlist Plunderer. The way I intend for the app to function is, the app will play the songs in the playlist, and then it will use shazamkit to recognize the song thats playing, it will then copy the metadata results of that song to rewrite the metadata of the song in the music playlist. I am still in the beginning stages. and I am very new to xcode. I created a apple developer account, paid the $99 and it is active, and I added the identifier bundle to the account from my app. I am VERY new to xcode,(this is my first project) my development team is set ( Shane Vincent), and the app is set to automatically manage signing, under app sandbox. i have audio input checked, under hardened runtime/ resource access audio input is checked. in build settings the path to the info.plist file is correct, the info.plist contains Privacy - Microphone Usage Description that I added i think it was called NSMmicriphone or something, with a description that reads "This app needs to access the microphone to identify songs using ShazamKit." the app appears under System Preferences > Security & Privacy > Privacy > Microphone but not under System Preferences > Security & Privacy > Privacy > Automation it is being made on macOS 14.1.2 (23B92) and xcode Version 15.4 (15F31d) Under framework library, and embedded content, I have added two frameworks, Shazamkit.framework, and ScriptingBridge.framework, both set to do not embed Current Issue: AppleScript fails to authorize with the Music app, and ShazamKit errors suggest an issue with song matching. Has anyone faced similar challenges or can offer guidance on how to ensure AppleScript and ShazamKit function correctly within a sandboxed macOS app? Any insights into troubleshooting or configuring entitlements more effectively would be greatly appreciated. Thanks for your help!
0
0
54
2d
Workout validation and Scheduler logic
Hey folks, a couple of questions regarding WorkoutKit: What happened to validation errors? They are mentioned in the WWDC23 video, but no longer are present in the API. It seems a fatal error is thrown if the workout fails validation (for example setting a negative distance in a workout goal). What is the logic of the WorkoutScheduler, if we try to add more workouts than is allowed? If the limit is 50, what happens when we try to add a 51st? Are workouts de-queued based on date or anything? API documentation is very sparse Do completed workouts and workouts with a scheduled date in the past stay in the WorkoutScheduler? Are we responsible for removing these? I guess my overall question regarding the WorkoutScheduler is, what are we responsible for managing and what is handled gracefully for us. None of these answers seem to be openly available, but if anyone know anecdotally or even better from the WorkoutKit team, I'd be very grateful! Thanks!
0
0
52
2d
PayWithApplePayButton SwiftUI API
During the WWDC2022 talk "What's new in Apple Pay - WWDC2022" the new SwiftUI implementation of Pay with Apple Pay was introduced. During the talk only a code snipped is shared (screenshot). Is there any example app or reference code that uses the APIs? Especially: PayWithApplePayButton and PayWithApplePayButtonPaymentAuthorizationPhase Link to the talk: What's new in Apple Pay - WWDC2022
0
0
46
2d
I referred to the Enhanced Sensor Access code from WWDC24 to display the main camera of Vision Pro in the application interface, but it is not displaying
this is my code: import Foundation import ARKit import SwiftUI class CameraViewModel: ObservableObject { private var arKitSession = ARKitSession() @Published var capturedImage: UIImage? private var pixelBuffer: CVPixelBuffer? private var cameraAccessAuthorizationStatus = ARKitSession.AuthorizationStatus.notDetermined func startSession() { guard CameraFrameProvider.isSupported else { print("Device does not support main camera") return } Task { await requestCameraAccess() guard cameraAccessAuthorizationStatus == .allowed else { print("User did not authorize camera access") return } let formats = CameraVideoFormat.supportedVideoFormats(for: .main, cameraPositions: [.left]) let cameraFrameProvider = CameraFrameProvider() print("Requesting camera authorization...") let authorizationResult = await arKitSession.requestAuthorization(for: [.cameraAccess]) cameraAccessAuthorizationStatus = authorizationResult[.cameraAccess] ?? .notDetermined guard cameraAccessAuthorizationStatus == .allowed else { print("Camera data access authorization failed") return } print("Camera authorization successful, starting ARKit session...") do { try await arKitSession.run([cameraFrameProvider]) print("ARKit session is running") guard let cameraFrameUpdates = cameraFrameProvider.cameraFrameUpdates(for: formats[0]) else { print("Unable to get camera frame updates") return } print("Successfully got camera frame updates") for await cameraFrame in cameraFrameUpdates { guard let mainCameraSample = cameraFrame.sample(for: .left) else { print("Unable to get main camera sample") continue } print("Successfully got main camera sample") self.pixelBuffer = mainCameraSample.pixelBuffer } DispatchQueue.main.async { self.capturedImage = self.convertToUIImage(pixelBuffer: self.pixelBuffer) if self.capturedImage != nil { print("Successfully captured and converted image") } else { print("Image conversion failed") } } } catch { print("ARKit session failed to run: \(error)") } } } private func requestCameraAccess() async { let authorizationResult = await arKitSession.requestAuthorization(for: [.cameraAccess]) cameraAccessAuthorizationStatus = authorizationResult[.cameraAccess] ?? .notDetermined if cameraAccessAuthorizationStatus == .allowed { print("User granted camera access") } else { print("User denied camera access") } } private func convertToUIImage(pixelBuffer: CVPixelBuffer?) -> UIImage? { guard let pixelBuffer = pixelBuffer else { print("Pixel buffer is nil") return nil } let ciImage = CIImage(cvPixelBuffer: pixelBuffer) let context = CIContext() if let cgImage = context.createCGImage(ciImage, from: ciImage.extent) { return UIImage(cgImage: cgImage) } print("Unable to create CGImage") return nil } } this my log: User granted camera access Requesting camera authorization... Camera authorization successful, starting ARKit session... ARKit session is running Successfully got camera frame updates void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL
0
0
63
2d
How to send x,y data from HIDStylusDriver to StylusApp to Pen/Draw
Here is project I am researching: https://developer.apple.com/documentation/hiddriverkit/handling_stylus_input_from_a_human_interface_device I have a Touch screen and I want: can control this screen, I can enable extension and control Touch screen successfully. can pen on this screen. To do this, I need to send X,Y to StylusApp(AppKit) But I Can not send X, Y to Swift StylusApp Eventhough I can log X,Y it by default code: But I don't know how to send it to AppKit to Pen. I have research about communicate Driver and Client: https://developer.apple.com/documentation/driverkit/communicating_between_a_driverkit_extension_and_a_client_app#4324306 but seem HID driver don't support inheritance from IOUserClient:
1
0
46
2d
How to get all ManagedSettingStore objects
Using the Screen Time API, I can create multiple ManagedSettingStore objects with different names. Is there a way to retrieve these later by name? For example, if I create them dynamically from a configuration managed by the user of my app, and the app crashes or its data gets corrupted, how can I get rid of "stale" ManagedSettingStore objects that I no longer know? Or, if I somehow lose the name of a ManagedSettingStore I created, how long does the store stay active? Forever? How can I get rid of the "stale" store?
0
1
34
2d
can a sysext with earlyboot propertykey enabled run it's host app before other app run?
hi! I know endpoint security sysext with earlyboot property key enabled will run before all other applications run while system booting. presume all these are done before earlyboot time out: sysext run it's host app, host app notify sysext to subscribe some events through xpc, then other apps start runing. though this whole process seems to violate "sysext runs before all other applications run"... I still wonder is this possible?
1
0
68
2d
Questions about ConsumptionRequest properties
Hello. platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase?
1
0
79
2d
Screen Time Crash Bug & Downtime Features Taken Away
I have recently noticed that ever since I downloaded iOS 18 Public Beta 1, I have been unable to get to the screen time settings, after clicking the tab, the app just freezes. Although after a while I did get to the Screen Time tab, but all of the previous changes to my screen time were voided. App limits, Downtime, you name it, all gone. While my app limits do not work, I noticed that downtime still functioned, but when my parent changed the downtime settings on their phone (running iOS 17 no betas), it did nothing on my end. I am currently submitting feedback to apple and am trying to find workarounds. On an unrelated note to this issue, I noticed that “One More Minute” and “Request More Time” aren‘t there anymore, does anybody have any ideas or workarounds on any of these?
0
1
55
2d
How the app behaves when an AccountNotFoundError is returned by the App Store Server API.
We are currently implementing in-app purchases with auto-renewing subscriptions. If an AccountNotFoundError is returned from the App Store Server API, is it correct for the app to stop the service offered with that subscription? The documentation does not go into detail, so I am just checking to be sure. https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
0
0
77
3d
How to populate the Finder comments field from NSFileProviderItemProtocol
In NSFileProviderItemProtocol I am able to use the extendedAttributes property call to add my custom extended attributes to my NSFileProviderReplicatedExtension extension files. Given that the Finder uses com.apple.metadata:kMDItemFinderComment extended attribute for file comments I thought it would be possible to populate my files with useful comments provided by the third part API. Unfortunately I seems to be unable to do so as if com.apple.metadata.... fields were inaccessible from the FP extension. Is there any way to achieve this ?
0
0
70
3d
NEIKEv2Provider connection disconnects and includeAllNetworks
Hi all, I'm working on deploying a VPN for users of our enterprise app, using the built-in IKEv2 provider (configured either by a configuration profile or an app). I'm struggling to get the user experience right and was curious to hear if the behaviors I'm observing have been seen by other developers. The main behavior I am observing is that the client tends to randomly disconnect, and it does not attempt to reconnect. This is particularly problematic when paired with the includeAllNetworks option. Paired with includeAllNetworks: The device does not attempt to reconnect the tunnel Once the tunnel disconnects, onDemandRules don't seem to evaluate. Even if a NEOnDemandRuleConnect rule matches the current network, the connection does not reestablish. All network traffic remains blocked on both WiFi and Cellular (rendering any network-dependent app unusable) until the user intervenes and toggles the connection in the Settings app This seems like a problematic user experience and I would be surprised if this is by design. As for the disconnects themselves, I have had a hard time correlating them to any particular network condition or protocol behavior. I've seen a connection drop after as little as 10 minutes and stay up for over 16 hours (including while the device roamed from WiFi to Cellular networks and in and out of connectivity). We confirmed with server logs that the clients were able to successfully re-key both the IKE SA and CHILD SAs. I had difficulty retrieving system logs from iOS, but on macOS I was able to observe this error from NEIKEv2Provider that lined up with one of the disconnect events: "Internal: Initiate MOBIKE failed to migrate child SAs" (server logs showed a successful rekey exchange at the same time). Thanks, Lucas
0
0
32
3d
Usage of IsSIMInserted in iOS 18
I am developing an iOS application where I need to detect if a SIM card is inserted in the device(either physical / eSim). I am targeting iOS 12 and later. I have tried using CTTelephonyNetworkInfo and CTSubscriber, but I am encountering issues with permissions and API availability in iOS 18 beta 3. if #available(iOS 16.0, *) { let subscriber = CTSubscriber() if #available(iOS 18.0, *) { do { if subscriber.isSIMInserted { return "SIM card is inserted." } else { return "No SIM card detected." } } catch { return "Error determining if SIM is inserted: \(error.localizedDescription)" } } else { return "isSIMInserted is only available on iOS 18.0 or newer." } } else { return "isSIMInserted is only available on iOS 16.0 or newer." } if let carriers = networkInfo.serviceSubscriberCellularProviders, let carrier = carriers.first?.value, let _ = carrier.mobileNetworkCode { return "SIM card is available.\nCarrier Name: \(carrier.carrierName ?? "None")" } else { return "No SIM card installed" } } in iOS 18 it always returning No SIM card detected. XCode Version 16.0 beta 3 (16A5202i) iPhone OS: iOS 18.0 (22A5307i) is there anything did I miss? or any documentation for the implementation would be helpful. Thanks
1
0
45
3d
Q: what enrollment or application needed to implement Apple Access with Express Mode?
Hi. I'm planning of creating a system for in-office access control that allows putting employee ID card in Apple Wallet to unlock the door without unlocking iPhone, something like HID Global's Employee Badge in Apple Wallet. I searched and it seems that Apple Access is suitable for unlocking the office door, but I couldn't find any relevant development documentation. What kind of enrollment or application is required to put my employee ID card in Apple Wallet with Apple Access and use Express mode? Also, could one share any related development documents please? Thank you in advance.
0
0
72
3d
Message app
Ever since ios 18 beta my message app crashes i get like 10 seconds and then it kicks it back to homescreen already reset my phone did a hard reset erased my phone completely and started over and still same issue
1
0
84
3d
Universal links & redirect not working on certain devices
We are currently doing our beta testing for our application and we are having some issues with universal links. The issues can be seen below: we are using auth0 for authentication. In this process, after users verify their email addresses they should be redirected back to the application. For some users, they are directed back to a page that shows error 404. For other users where it works, they are directed back to the application. What could be my issue? Our app-site- association file is hosted in the link below for reference. https://yourmomentshub.com/.well-known/apple-app-site-association
1
0
99
3d
AccessorySetupKit
I am trying to setup AccessorySetupKit. I have several questions: Is it possible to setup classic Bluetooth accessory? In documentation you say: "Each display item’s ASDiscoveryDescriptor needs to have a bluetoothCompanyIdentifier or bluetoothNameSubstring, and at least one of the following accessory identifiers: bluetoothServiceUUID Either ssid or ssidPrefix, which needs to have a non-zero length. It’s an error to supply both SSID and SSIDPrefix, and your app crashes if you do. A bluetoothManufacturerDataBlob and bluetoothManufacturerDataMask that are the same length. A bluetoothServiceDataBlob and bluetoothServiceDataMask that are the same length." Is it possible to have only bluetoothCompanyIdentifier and UUID ?
0
0
67
3d