Delve 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.

Post

Replies

Boosts

Views

Activity

How can I access audio attachment from INSendMessageIntent
I'm trying to add Siri support to my app for sending voice messages. I've implemented INSendMessageIntentHandling in my main app target. It looks like it's getting as far as recording the voice message and passing my intent handler an INSendMessageIntent with an audio attachment, but I'm not able to read the attachment file. func handle( intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void ) { if let attachment = intent.attachments?.first, let audioFile = attachment.audioMessageFile, let fileURL = audioFile.fileURL { // This branch runs // fileURL is "file:///var/mobile/tmp/SiriMessages/89F738F7-6092-439A-B4FA-2DD9A99F0EED.caf" let result = processMessageAudio(url: fileURL) completion(result) return } // This line isn't reached completion(.init(code: .failure, userActivity: nil)) } private func processMessageAudio(url: URL) -> INSendMessageIntentResponse { var fileRef: ExtAudioFileRef? if url.startAccessingSecurityScopedResource() { logDebug("File access allowed") } else { // This branch runs logDebug("File access not allowed") } defer { url.stopAccessingSecurityScopedResource() } let openStatus = ExtAudioFileOpenURL(url as CFURL, &fileRef) // openStatus is -54 (kAudio_FilePermissionError) return INSendMessageIntentResponse(code: .failure, userActivity: nil) } I'm not sure what I'm missing. It looks like there should be an audio file, and Siri shows a preview of the audio for confirmation.
0
0
19
2h
Built-in Spin Control?
On and off I've been trying to figure out how to do hang detection in-application (at least from the user's point of view). Qualitatively what I'd like to do is have a process which runs sample(1) on the application after it's been unresponsive for more than a second or so. Basically, an in-app replacement for Spin Control. The problem I've been stuck on is: how do I tell? There used to be Core Graphics SPI (CGSRegisterNotifyProc with a value of kCGSEventNotificationAppIsUnresponsive) for doing this, but it doesn't work anymore (either due to sandboxing or system-wide security changes, I can't tell which but it doesn't matter). One thought I had was to have an XPC service which would expect to receive a checkin once per second from the host (via a timer set up by the host). If it didn't, it would start sample(1). This seems pretty heavyweight to me, since it means that once per second, I'm going to be consuming cycles to check in with the service. But I haven't been able to come up with a scheme that doesn't include some kind of check-in by the target process. Are there any APIs or strategies that I could use to accomplish this? Or is there some entitlement which would allow the application to request "application became unresponsive"/"application became responsive" notifications from the window server?
0
0
34
6h
Issues with Apple Nearby Interaction app not detecting DWM3001CDK accessory
Hi everyone, I’m having trouble getting my iPhone 11 to detect a DWM3001CDK as an accessory using the Apple Nearby Interaction app. Here’s the background: Two years ago, I successfully tested UWB ranging between the same devices (iPhone 11 and DWM3001CDK, which is based on the Qorvo DW3110 IC and an nRF52833 SoC with Bluetooth 5.2). At that time, the Nearby Interaction app was in beta and worked well for my tests. Now, with the stable version of the app, I’m encountering an issue. Here’s what I’ve done so far: I erased the DWM3001C and flashed it with the Qorvo Nearby Interaction firmware (v3.2.0, "DWM3001CDK-QANI-FreeRTOS_full_QNI_3_0_0.hex") using J-Flash Lite V7.86g on Windows. With this configuration, I can connect the iPhone 11 to the accessory using the Qorvo NI apps, both in the foreground and background. However, when I compile and run the project "ImplementingSpatialInteractionsWithThirdPartyAccessories" (available on the Apple Developer website) on my iPhone 11 (running iOS 17.7), the app remains stuck on the "Scanning for accessory" screen and doesn’t find the device, even though I’ve given the app permission to use Bluetooth. Could this be due to an issue with the firmware I flashed on the DWM3001CDK, or might there be something else causing the problem? Any help or insights would be appreciated! Thanks in advance.
0
0
29
8h
Determining "volumes" of paths on macOS and iOS.
Hi, so as I understand it is not possible to know what all possible sources of files are available on iOS using some api call (by sources I mean smb shares connected, iCloud, gdrive, etc), the only paths I can get are the app sandbox, app group container and the same on iCloud. I can get the list of mount points in macOS using getmntinfo(), app/group sandbox and apart from these whatever standard locations I have given access to to my sandboxed app. Are there other paths that I can get? I want to know how I can determine the volume given a user picks a file using a file picker. Say, they picked 10 files from gdrive and another 5 from local storage. If I encounter some errors on the files from gdrive I want to stop working on all 10 of them but to do that I need to be able to determine that that are on this particular volume. Is there a way to do this programmatically? Ex: gdrive on iOS : "/private/var/mobile/Containers/Shared/AppGroup/6208BBEE-24BF-4CC9-A9ED-846F987C0442/File Provider Storage/39822865/1P8WD1tWEaq81ZB_DodTTZhXm0p00QaF7/test.txt" on MacOS: "/Users/username/Library/CloudStorage/GoogleDrive-useremailid/My Drive"
0
0
36
8h
Adding group between watchOS 11.1 and iOS 18.1 results in Error on data save
I am developing an iOS and watchOS app that share data using App Groups. The App Group identifier is group.(myteamid).dev.christopherallen.vtipz. The iOS app saves a QR code URL to the shared App Group container, and the watchOS app reads this URL to display the QR code image. Steps to Reproduce: 1. Configure both the iOS and watchOS targets to use the App Group group.(myteamid).dev.christopherallen.vtipz in the "Signing & Capabilities" tab in Xcode. 2. Save the QR code URL to the shared App Group container in the iOS app using UserDefaults. 3. Attempt to read the QR code URL from the shared App Group container in the watchOS app using UserDefaults. Code Snippets: iOS App Code to Save URL: private func saveQrCodeUrlToAppGroup(url: URL) { if let sharedDefaults = UserDefaults(suiteName: "group.(myteamid).dev.christopherallen.vtipz") { sharedDefaults.set(url.absoluteString, forKey: "qrCodeUrl") } } watchOS App Code to Read URL: private func loadQrCodeImage() { if let sharedDefaults = UserDefaults(suiteName: "group.(myteamid).dev.christopherallen.vtipz"), let urlString = sharedDefaults.string(forKey: "qrCodeUrl"), let url = URL(string: urlString) { fetchAndSaveImage(from: url) } else { showError = true } } Error Encountered: When attempting to read the QR code URL from the shared App Group container in the watchOS app, the following error is logged: Couldn't read values in CFPrefsPlistSource<0x300b19880> (Domain: group.(myteamid).dev.christopherallen.vtipz, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd Troubleshooting Steps Taken: 1. Confirmed that the App Group identifier is correctly set up in the Apple Developer portal. 2. Ensured that both the iOS and watchOS targets have the same App Group enabled in the "Signing & Capabilities" tab in Xcode. 3. Verified that the App Group identifier used in the code matches exactly with the one configured in Xcode. Request for Assistance: I am seeking assistance to understand why this error occurs and how to resolve it. • Are there any additional steps required to properly access the shared App Group container? • Any insights or suggestions to resolve this issue would be greatly appreciated.
1
0
62
17h
cannot find certificate signing request/Certificate Assistant
I've been working on creating a CSR for about two hours now and I cannot find a Certificate assistant anywhere. I can open up keychain access, on the left I have login and cloud and system and system roots. there are 6 submenus under keychain access: All Items, Passwords, Secure Notes, My Certificates, Keys, and Certificates. I have used the search menu to find both in the search bar 'Certificate Assistant" and also Certificate Signing Request, and neither is anywhere to be found. I've looked on the developer Account help, I've read several places what you are supposed to do, I've see the illustrations where you enter the email and leave the CA email blank, I just can't find it anywhere around Keychain access. It is really really well described on the Developer account help, and the eskimo makes it sound really easy too, only nothing appears in my keychain access. I've scrolled through all of the submenus trying to find it and it is nowhere to be fount. Any help would be much appreciated
2
0
65
19h
Family Controls Entitlement Request: How Long for Approval?
A few weeks ago, I submitted a request for the Family Controls & Personal Device Usage Entitlement to enable my app to access the Managed Settings and Device Activity frameworks in the Screen Time API. The app is nearly complete, with the only remaining component being the Family Controls capability. As of now, I haven’t received a response regarding the request. I’m wondering if anyone else has experienced a similar situation or can provide insight into the following: • How long does it typically take to receive feedback on this type of entitlement request? • Is there a way to check if a request is still active and under review? • Is a finished website required for the entitlement to be granted? Any information or guidance would be greatly appreciated!
0
1
37
1d
Apple app site association CDN cache does not work with IPv6 only servers.
Hi, We have an IPv6 only server setup, where we have put AASA file as required: https://qa-jen.noknoktest.com/.well-known/apple-app-site-association But Apple CDN does not found it: https://app-site-association.cdn-apple.com/a/v1/qa-jen.noknoktest.com Is there any restriction on IPv6 only servers? Everything works with our other IPv4 servers. Note: With alternate mode configuration in application, the AASA is accessible to devices. There is no any geo restriction or IP filtering for server. What is missing to force CDN cache the file fro mentioned server?
0
0
69
1d
Unable to Retrieve bundleIdentifier with FamilyControls .individual Authorization
Tl:dr What are some reasons my bundleIDs aren't showing up and does anyone have good resources to setup the screentime API/DeviceActivityMonitorExtension? I'm working on an iOS app that uses the FamilyControls and DeviceActivity frameworks to monitor and restrict app usage. The app allows users to select apps and set usage limits. When a limit is reached, a DeviceActivityMonitorExtension should block the selected apps. My App setup: Have a model that is called when users select apps to manage these app bundle IDs are then serialized and sent to the Device Monitor Extension via App Group so it can be used when the event threshold is reached. Cant use Application Tokens because they are not serielizable and cant be passed to the extension. Problem: While testing, I’m unable to retrieve the bundleIdentifier and localizedDisplayName from the Application objects after selecting apps. Instead, these properties are nil or empty, preventing me from saving the bundle IDs to share with the extension via App Groups. Assumptions: I suspect this issue is due to missing the com.apple.developer.screentime.api entitlement, which might be required to access these properties even during development. I've requested for the entitlement but its still under review. Key Code Snippets: Authorization Request: class ScreenTimeManager: ObservableObject { static let shared = ScreenTimeManager() @Published var isAuthorized: Bool = false func requestAuthorization() async { do { try await AuthorizationCenter.shared.requestAuthorization(for: .individual) DispatchQueue.main.async { self.isAuthorized = AuthorizationCenter.shared.authorizationStatus == .approved print("Authorization status: \(AuthorizationCenter.shared.authorizationStatus)") } } catch { DispatchQueue.main.async { print("Authorization failed: \(error.localizedDescription)") self.isAuthorized = false } } } } Accessing bundleIdentifier: print("addAppGroup() Called") let managedApps = selection.applications.compactMap { application -> ManagedApp? in guard let token = application.token else { print("No token for application: \(application)") return nil } let app = Application(token: token) print("New Application instance: \(app)") guard let bundleID = app.bundleIdentifier, !bundleID.isEmpty else { print("Bundle identifier is empty or nil for application: \(app)") return nil } let displayName = app.localizedName ?? "Unknown App" print("Processing application with bundleIdentifier: '\(bundleID)' and displayName: '\(displayName)'") return ManagedApp( bundleIdentifier: bundleID, applicationToken: token, localizedDisplayName: displayName ) } if managedApps.isEmpty { print("No managed apps created. Exiting addAppGroup().") return } // Continue with creating DeviceActivityEvent... } Logs - Shows application token but never bundleID or LocalizedDisplayname Application(bundleIdentifer: nil, token: Optional(128 byte <TOKEN_PRESENT>), localizedDisplayName: nil) What I've Tried: Ensured Screen Time is enabled on the device. Verified App Group configuration in both app and extension. Checked that authorization is being requested and the status is .approved. Cleaned and rebuilt the project. Questions: Is the com.apple.developer.screentime.api entitlement required to access bundleIdentifier and localizedDisplayName when using .individual authorization? Is there a way to access these properties without the entitlement, or am I missing a configuration step? Has anyone faced a similar issue and found a solution? Lastly, is there a good place for additional resources on the screentime API??
1
0
104
2d
Instant access to call log with new ios 18 commands
Hello, I am wondering about developing my application. Can the new commands available with iOS 18 give me access to the call log (recent calls)? With a request prior to installing the application for example. I saw that Truecaller has just launched an update on iOS to offer the same features as Android, i.e. capture the call log. Apple allows applications like Truecaller to integrate their spam databases into the iOS caller ID system. I wonder by which command! Otherwise, I can perhaps use the "SMS and Call Spam Reporting" commands and divert them to retrieve the call log. To tell you the truth, I'm trying to find, for my application, a way to retrieve recent call data to create a call dashboard of certain calls, by retrieving the name or phone number, call date, call time and call duration. Does anyone have an idea?
2
0
86
3d
How to create Stick Pack with custom UI
Hi, I'd like to develop sticker packs for iMessage. In particular, I'd like to have custom UIs so user can select different groups of stickers under the same sticker drawer. Based on what I read in the developer doc, sticker pack does not allow custom UIs, and I have to go to iMessage apps. However, I discovered quite a few sticker packs have custom UIs. For example, GIPHY, Fluffcorn, Animal Stickers, Mochj Cat, they are in sticker drawer but they still have custom UIs with tabs. How is this possible? Is there something I'm missing from the developer doc? Thanks a lot!
1
1
70
3d
Detection of installed web browsers on Mac OS
Platform: macOS, Sonoma 14.6 Technology stack: Electron v29, TypeScript Hello, We're developing a desktop app for macOS that helps with automation of some browser related tasks, using Puppeteer and Chrome/Chromium browsers. One of the conditions of our app running is having Chrome/Chromium installed on the computer. To check if someone has installed one of the supported browsers our app runs the following command in the shell: mdfind "kMDItemKind == \'Application\'" it produces the list of installed apps and then we scan the list in the search of Chrome or Chromium. Recently we found out that the command's result is not consistent, because on some macOS computers the result is empty and we don't know why. Are we misunderstanding the usage of mdfind? Or maybe we should try a different way to check if Chrome or Chromium is installed on the computer running our app? Thank you.
2
0
69
4d
Siri's voice invocation to open App and pass the intent
Hi All, requirement - "Search (placeholder) in (myApp)". When user speaks this strings, Siri should open the app and pass the placeholder. This worked for me only when i used an AppEnum (with specific defined set) with AppEntity. I want the placeholder to be dynamic and not defined via the AppEnum. Have observed this feature working fine with Youtube, Spotify & Whatsapp apps. Is there anything else that these app add specifically to make this work. ? Also in these app's Siri settings, there is a toggle named - 'Use with Ask Siri'. Could someone please help in understanding, how this option is enabled ?
4
0
136
4d
iOS18 main_executable_path_missing
A crash appears when you run the app after the iOS18 update. Translated Report (Full Report Below) ... Exception Type: EXC_CRASH (SIGKILL) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: GUARD 5 Triggered by Thread: 0 Thread 0 Crashed: 0 dyld 0x1bc7462b0 lsl::PreallocatedAllocatorLayout<278528ull>::init(char const**, char const**, void*) + 436 1 dyld 0x1bc73fa38 start + 1960 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x2010003030100000 x1: 0x0000000fffffc0d0 x2: 0x0000000000000006 x3: 0x00000001bc7147a7 x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000 x8: 0x2010003030100000 x9: 0x2010003030100000 x10: 0x000000016afd3dff x11: 0x00000001bc780f30 x12: 0x0000000000000050 x13: 0x0000000000000044 x14: 0x0000000000052010 x15: 0x0000000000000000 x16: 0x0000000000000000 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000194188000 x20: 0x000000016afd3b38 x21: 0x000000016afd3ae0 x22: 0x00000001fa138050 x23: 0x000000016afd37c8 x24: 0x0000000fffffc10c x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000 x28: 0x0000000000000000 fp: 0x000000016afd3860 lr: 0x00000001bc746130 sp: 0x000000016afd37c0 pc: 0x00000001bc7462b0 cpsr: 0x60001000 far: 0x00000001fa1380e0 esr: 0x92000047 (Data Abort) byte write Translation fault Binary Images: 0x1bc70c000 - 0x1bc78f693 dyld arm64e <77c1eed22ed7396aba34e770120d81d4> /usr/lib/dyld 0x104e2c000 - 0x1064b7fff main_executable_path_missing arm64 /main_executable_path_missing 0x0 - 0xffffffffffffffff ??? unknown-arch <00000000000000000000000000000000> ??? Error Formulating Crash Report: dyld_process_snapshot_get_shared_cache failed EOF
1
1
88
4d
How to correctly use AppIntentsExtension with AppShortcutsProvider
I've watched the following 3 WWDC videos on intents and after watching, decided to try and implement an AppIntentsExtension. All my intent action does is run a network request in the background. So it seems like I should be putting it in an AppIntentsExtension instead of in the main app to avoid having to launch the app in the background, and instead have it run directly in the extension. 2022 https://developer.apple.com/videos/play/wwdc2022/10032?time=1620 2023 https://developer.apple.com/videos/play/wwdc2023/10103?time=880 2024 https://developer.apple.com/videos/play/wwdc2024/10134/?time=992 If I just put the intent and shortcut provider code I need inside an AppIntentsExtension, everything works fine except for 1 thing. I have no way to call updateAppShortcutParameters on my AppShortcutsProvider from the main app because it is defined inside the extension. So I have no way to let siri know to re-query my parameterized phrases, and so siri doesnt expose any new phrases when things in the app are updated. So to solve this, I somehow need a way to access the AppShortcutsProvider from within the main app to be able to call updateAppShortcutParameters https://developer.apple.com/documentation/appintents/appshortcutsprovider/updateappshortcutparameters() What is the recommended way to do this? Should I be trying to create a separate framework with the shortcut provider, which is then used by both the main app an extension? I tried doing this but ran into a few build errors. I tried changing the target membership of the AppShortcutsProvider to have the file in the extension, but include both the main app and intent extension, this seems to work, but I am unsure if this is the correct approach.
1
0
78
5d
App Clip Card not appearing on initial page load
I have no idea why my app clip card is not showing on initial url load, it doesn't even show when I refresh the page. The only thing that works is pull to refresh (once or more times). After that, it shows up. Is it possible to fix this issue and show app clip card on url load? Here's the appclip url (for some reason I can't post href): https://app.celer.life/reading-exercise Initial load: After pull to refresh:
2
0
82
5d
UserDefaults.didChangeNotification not firing
Hi, I'm currently working on an app made originally for iOS 15. On it, I add an observer on viewDidLoad function of my ViewController to listen for changes on the UserDefault values for connection settings. NotificationCenter.default.addObserver(self, selector: #selector(settingsChanged), name: UserDefaults.didChangeNotification, object: nil) Said values can only be modified on the app's section from System Settings. Thing is, up to iOS 17, the notification fired as expected, but starting from iOS 18, the notification doesn't seem to be sent by the OS. Is there anything I should change in my observer, or any other technique to listen for the describe event? Thanks in advance.
1
0
106
5d