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

Unable to call code inside App Intent Extension like updateAppShortcutParameters() - Linking error
Was watching this latest WWDC 2023 video and had a question. I see about 17:20 in, they mention you can now put the shortcut provider in an app intent extension. https://developer.apple.com/videos/play/wwdc2023/10103/ This works fine by itself and I can see all my shortcuts and use siri, but as soon as I try to call into the extension from the main app in order to trigger updateAppShortcutParameters() or any other code, I get a linker error. Am I doing something obvious wrong? Note, I called it a framework, but it Is just an extension. Cant figure out how I am supposed to be calling this method. Any help is greatly appreciated! https://developer.apple.com/documentation/appintents/appshortcutsprovider/updateappshortcutparameters()?changes=_4_8 https://imgur.com/a/yDygSVJ
1
0
696
Sep ’23
FinderSync Extension UI disappear on macOS 15's Setting
Description We used to use FIFinderSyncController.showExtensionManagementInterface() to navigate to the corresponding Setting's path via a button in our app to make the user enable our FinderSync App. (Or user can navigate manually via "System Settings -> Privacy & Security -> Extensions -> Added Extensions" themselves in Settings.app) But the UI is now disappearing on macOS 15.0 As a result, if user had previously enabled it, user will now be unable to disable it, and if user had not previously enabled it, user will never be able to enable it. STEPS TO REPRODUCE Create an empty macOS app xcodeprojc, add Finder Sync Extension and run it. Or you can use the repo here to reproduce the issue. https://github.com/Kyle-Ye/MenuHelper
2
2
301
Sep ’24
After updating iOS 18 CXCall is giving wrong values in hasConnected and hasEnded when user reject the call
Dear Apple team, I would like to report a problem that started after update my iPhone to iOS 18.0.1. When user receives a call and reject, CXCall is giving wrong values compared the previous version of iOS (minor of 18). In iOS 17.7, we received this values: hasConnected = false hasEnded = true iOS 18.0.1 we received 2 CXCall events: first event hasConnected = true hasEnded = false second event hasConnected = true hasEnded = true This behaviour is strange and not intuitive, and if we check the documentation, don`t make sense: A call is considered connected when both caller and callee can start communicating and A call is considered ended when the user disconnects or all other callers disconnect. Our code is very simple and use callObserver function to make the flow: public func callObserver(_ callObserver: CXCallObserver, callChanged call: CXCall) { if call.hasConnected, !call.hasEnded { //GoToViewControllerX } if call.hasEnded { //DoSomething } } With the behavior of iOS 18 the project will enter in first conditional and then will enter in second conditional. I need some help or some instruction because the intention ir only enter in first conditional if the call really happens.
2
3
236
Oct ’24
AdAttributionKit Development Testing problem
Hello. I would like to ask for an assistance with testing AdAttributionKit flow that seems not working. Goal: to close the AdAttributionKit logic flow loop starting from presenting and handling Ad in a publisher app and ending with receiving a postback request on my end point. Problem: No postback request is received on my configured domain. It looks like AdAttributionKit cannot connect between AppImpression invocation in Publisher App and updating postback from the Advertised App, hence no update postback request are transmitted to my endpoint. What was done: Testing device iPhone 13, iOS 18.0.1 Production Apple ID AdAttributionKit Developer Mode is enabled iPhone is reset and restarted Publisher App Test publisher application was created and configured (according to Apple's documentation [https://developer.apple.com/documentation/adattributionkit/configuring-a-publisher-app]) with the following: AdNetworkIdentifiers item was added to app's Info.plist with number of Ad Network IDs. I tried to use in my tests (used below insted of the placeholder): Registered SKAdNetwork Ad Network ID that ends with .skadnetwork Not registered Ad Network ID that ends with .adattributionkit JWS Impression was created with the following JWS Header: {"kid" : "","alg" : "ES256"} JWS Payload: {"impression-type" : "app-impression","impression-identifier" : "9547875E-C052-44CD-8CB9-193978CC5AB7", "timestamp" : 1729162517373,"publisher-item-identifier" : 0,"source-identifier" : 1111,"ad-network-identifier" : "","advertised-item-identifier" : 1125517808} JWS Data: "BASE64(JWS-Header)"."BASE64(JWS-Payload)"."SIGNED("BASE64(JWS-Header).BASE64(JWS-Payload)")" Signing was done with temporary key (created every time the JWS is composed) by the following: let signingInput = "\(headerBase64String).\(payloadBase64String)" let privateKey = Curve25519.Signing.PrivateKey() var encodedSignature = "" do { let signature = try privateKey.signature(for: Data(signingInput.utf8)) encodedSignature = base64UrlEncode(signature) } catch { print("Error signing JWS: \(error.localizedDescription)") } UIEventAttributionView (with UITapGestureRecognizer) was added to my ViewController's main view and in a handling method of TAP event, AppImpression was created baased on JWS above and handleTap() method of this AppImpression instance was called. AppImpression was tapped and AppStore has been launched (because to this moment no advertised app with was installed on a device): attributionkitd Preflighting impression AAKPubApp Connection established attributionkitd Validated impression for advertised app: <MY-ADVERTISED-APP-APPSTORE-ID-PLACEHOLDER> attributionkitd No distributor bundle ID received from app fetch attributionkitd Distributor metadata cached for item ID <MY-ADVERTISED-APP-APPSTORE-ID-PLACEHOLDER> attributionkitd Is anything happening? attributionkitd Processing tap attributionkitd Successfully validated publisher application attributionkitd Successfully finalized click through impression attributionkitd Impression is not eligible for re-engagement attributionkitd Launching distributor for itemID: <MY-ADVERTISED-APP-APPSTORE-ID-PLACEHOLDER> attributionkitd [0x70008b340] activating connection: mach=false listener=false peer=false name=(anonymous) attributionkitd Distributor launch completed for item ID: <MY-ADVERTISED-APP-APPSTORE-ID-PLACEHOLDER> Advertised App Advertised App is an existing application on the AppStore. It was configured according Apple's documentation [https://developer.apple.com/documentation/adattributionkit/configuring-an-advertised-app]. AttributionCopyEndpoint key with my domain ("https://<MY_DOMAIN_PLACEHOLDER>.com") was added to app's Info.plist EligibleForAdAttributionKitReengagementPostbackCopies key with "YES" value was added to Info.plist as well. Number of postback method calls were added to the application in different places including application:didFinishLaunchingWithOptions. Used AdAttributionKit method - (updateConversionValue(_:coarseConversionValue:lockPostback:)) [https://developer.apple.com/documentation/adattributionkit/postback/updateconversionvalue(_:coarseconversionvalue:lockpostback:)] Application is written in Objective-C while using AdAttributionKit via Swift-to-ObjC regular bridging. I tried to use Advertised App in the following ways: To run it from Xcode. This way, when the advertised app is already installed, AppImpression tap in the publisher App doesn't recognize the Advertised App is installed and launches AppStore. To install it from TestFlight. This way, AppImpression tap in the publisher App successfully recognizes the Advertised App is installed and launches it. Both ways yield the same result - explanation below. Advertised App launched - while calling update postback method in application:didFinishLaunchingWithOptions attributionkitd Updating postback attributionkitd Queueing update postback attributionkitd [TXNf0dc] 🐏 Beginning transaction (Task runner: atomic) attributionkitd Begin update postback <MY-APPLICATION-NAME-PLACEHOLDER> Connection established attributionkitd [TXN5421] 🐏 Ending transaction (<private>) (<private>) attributionkitd Retrieved conversion window thresholds: <private> attributionkitd [TXNf0dc] 🐏 Ending transaction (<private>) (<private>) ... attributionkitd Calling launch handler for com.apple.attributionkitd.development-postback-transmission attributionkitd Begin task for identifier: com.apple.attributionkitd.development-postback-transmission attributionkitd Running barktivity: com.apple.attributionkitd.development-postback-transmission attributionkitd [TXN46f0] 🐏 Beginning transaction (<private>) attributionkitd Found 0 postbacks eligible for transmission for environments: <private> attributionkitd Postback transmission completed attributionkitd [TXN46f0] 🐏 Ending transaction (<private>) (<private>) attributionkitd Marking task <BGRepeatingSystemTask: com.apple.attributionkitd.development-postback-transmission> complete attributionkitd Task completed for identifier: com.apple.attributionkitd.development-postback-transmission The problem I can see here is in the following line: attributionkitd Found 0 postbacks eligible for transmission for environments: <private> It looks like AdAttributionKit cannot connect between AppImpression invocation in Publisher App and updating postback from the Advertised App. Please correct me in case I'm doing anything wrong or missing anything. Thank you very much.
1
0
196
Oct ’24
Universal link failing to redirect to app in special circumstances
I'm developing two native apps and one is a authentication app and other one is business app. In the main flow if buisness application is on the foreground and did nothing for at least 10 minutes it will automatically time out and redirect to the autentication app for token refresh. In this flow universal link redirect to the authetication app without opening Safari. But if i execute the below flow buissness app redirect to the Safari. Buisness App In Foregorund → Displaying a OS screen while app is in Foreground(Like Push Notification Center) → On this satate leave device for 10 minutes → Buisness app will automatically timeout and rediret to Safari(In safari 「NoSuchKey The specified key does not exist.」message is displaying but authentication app Universal link Start button is showing) → After click the Universal Link start button in Safari Authentication App open. I use the below code to start the Universal Link: if let url = URL(string: path) { UIApplication.shared.open(url) } So i would like to know is there a special reason that when Displaying a OS screen while app is in Foreground(Like Push Notification Center) affect the normal flow of Universal redirection to another app?
0
0
193
Oct ’24
CoreGraphics: CGPDFPageCopyRootTaggedNode
My app uses PDFKit, but I don't know how to solve this bug at all. Under the same IOS system and device model, some users' devices may experience crashes, while our own devices are functioning normally. The following is the stack information for crashing: 0 libsystem_platform.dylib__os_unfair_lock_recursive_abort + 36 1 libsystem_platform.dylib__os_unfair_lock_lock_slow + 308 2 CoreGraphics_CGPDFPageCopyRootTaggedNode + 56 3 PDFKit-[PDFPageViewAccessibility accessibilityElements] + 76 4 UIAccessibility-[NSObject(AXPrivCategory) _accessibilityElements] + 56 5 UIAccessibility-[NSObjectAccessibility accessibilityElementCount] + 68 6 UIAccessibility-[NSObject(AXPrivCategory) _accessibilityHasOrderedChildren] + 44 7 UIAccessibility-[NSObject(AXPrivCategory) _accessibilityFrameForSorting] + 216 8 UIAccessibility-[NSObject _accessibilityCompareGeometry:] + 116 9 UIAccessibility-[NSObject(AXPrivCategory) accessibilityCompareGeometry:] + 52 10 CoreFoundation___CFSimpleMergeSort + 100 11 CoreFoundation___CFSimpleMergeSort + 248 12 CoreFoundation_CFSortIndexes + 260 13 CoreFoundation-[NSArray sortedArrayFromRange:options:usingComparator:] + 732 14 CoreFoundation-[NSMutableArray sortedArrayFromRange:options:usingComparator:] + 60 15 CoreFoundation-[NSArray sortedArrayUsingSelector:] + 168 16 UIAccessibility___57-[NSObject(AXPrivCategory) _accessibilityFindDescendant:]_block_invoke + 268 17 UIAccessibility___96-[NSObject(AXPrivCategory) _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:]_block_invoke + 140 18 UIAccessibility-[NSObject _accessibilityEnumerateAXDescendants:passingTest:byYieldingElements:] + 244 19 UIAccessibility-[NSObject _accessibilityFindFirstAXDescendantPassingTest:byYieldingElements:] + 272 20 UIAccessibility-[NSObject(AXPrivCategory) _accessibilityFindDescendant:] + 100 21 UIAccessibility__axuiElementForNotificationData + 276 22 UIAccessibility__massageAssociatedElementBeforePost + 36 23 UIAccessibility__UIAXBroadcastMainThread + 292 24 libdispatch.dylib__dispatch_call_block_and_release + 32 25 libdispatch.dylib__dispatch_client_callout + 20 26 libdispatch.dylib__dispatch_main_queue_drain + 980 27 libdispatch.dylib__dispatch_main_queue_callback_4CF + 44 28 CoreFoundation___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 29 CoreFoundation___CFRunLoopRun + 1996 30 CoreFoundation_CFRunLoopRunSpecific + 572 31 GraphicsServices_GSEventRunModal + 164 32 UIKitCore-[UIApplication _run] + 816 33 UIKitCore_UIApplicationMain + 340 34 SwiftUIclosure #1 (Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>?>) -> Swift.Never in SwiftUI.(KitRendererCommon in _ACC2C5639A7D76F611E170E831FCA491)(Swift.AnyObject.Type) -> Swift.Never + 168 35 SwiftUI SwiftUI.runApp(A) -> Swift.Never + 100 36 SwiftUI static (extension in SwiftUI):SwiftUI.App.main() -> () + 180
2
2
210
Oct ’24
Getting tracks from Recommendation Playlist
Hi all, I am working with MusicKit and have managed to get a user's recommendation playlists (favorites, get up, etc). Isolating just one, I am trying to access the tracks in there using .tracks but it returns nothing. Wondering if I am doing something wrong or if these don't have tracks necessarily associated with them. Code is below (not everything just kinda where I am accessing the playlist) try await requestMusicAuthorization() let request = MusicPersonalRecommendationsRequest() let response = try await request.response() guard let madeForYou = response.recommendations.first(where: { $0.title == "Made for You" }) else { throw NSError(domain: "RecommendationError", code: 0, userInfo: [NSLocalizedDescriptionKey: "No 'Made for You' recommendation found."]) } guard let firstPlaylist = madeForYou.playlists.first else { throw NSError(domain: "PlaylistError", code: 1, userInfo: [NSLocalizedDescriptionKey: "No playlists found in 'Made for You' recommendation."]) } print("Fetching tracks for playlist: \(firstPlaylist.name ?? "Unknown")") let playlistRequest = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: firstPlaylist.id) let playlistResponse = try await playlistRequest.response() guard let playlist = playlistResponse.items.first else { throw NSError(domain: "PlaylistError", code: 2, userInfo: [NSLocalizedDescriptionKey: "Couldn't fetch the playlist details."]) } guard let tracks = playlist.tracks else { throw NSError(domain: "PlaylistError", code: 3, userInfo: [NSLocalizedDescriptionKey: "No tracks found in the playlist."]) }
1
0
188
Oct ’24
callkit and contact app
Hello, I am a developer currently working on a personal contact management app. What is the app? My app stores additional information beyond basic contact details. Therefore, instead of using the Contacts framework, I manage contact objects using Core Data. What am I trying to achieve? I want to display additional information on the caller ID screen when a call is received from a number stored in my app. What have I tried? I’ve attempted the following methods without success: 1. Call Directory Extension: I thought using this method would allow me to display additional information from Core Data on the call screen. However, I learned that when a call is received, the iOS system first searches for the phone number in the Contacts app and only looks to the Extension app if no match is found. Therefore, displaying contact information from my app seems unfeasible. 2. Custom Call UI: Using CallKit seemed like a viable option to display the necessary information during a call, but it appears to only be possible with VoIP apps. My app does not support VoIP calls, so this method was also not implementable. I am wondering if there are any technologies available that could help me achieve my goal, or if there’s something I might be missing. Any advice would be greatly appreciated. Thank you! If a similar question has been asked, I apologize for the repetition.
3
0
300
Oct ’24
Is it possible to create an App that can't be Deleted?
I want to create an app with features blocking certain content on the internet and iPhone. Before I start coding the app I wanted to see if it's possible with the user's permission to create an app that can't be deleted until after 3 days/timer. Is it possible to create an app with this feature and put it on the Apple Store or do they not allow this?
1
0
168
Oct ’24
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?
8
0
430
Sep ’24
BGProcessingTaskRequest execute randomly.
I am using BGProcessingTaskRequest to fetch a API make my app up to date. Sometimes this background task execute with 10 minutes some times it take more than 10 mins, Some other times its never execute. But in my case im provide just 1 minute to BGProcessingTaskRequest.earliestBeginDate variable. And i will share my implementation here, My codes are, Called the register function before app launching. let taskId = "_________" func registerBackgroundTaks() { BGTaskScheduler.shared.register(forTaskWithIdentifier: taskId, using: nil) { task in self.handleBackgroundProcessRequest(task: task as! BGProcessingTask) } print("Receiver called") } Called the scheduleBackgroundPrecessingTask function when application enter in background mode. func scheduleBackgroundPrecessingTask() { let request = BGProcessingTaskRequest(identifier: taskId) request.requiresNetworkConnectivity = false // Need to true if your task need to network process. Defaults to false. request.requiresExternalPower = false request.earliestBeginDate = Date(timeIntervalSinceNow: 1 * 60) // Featch Image Count after 1 minute. do { try BGTaskScheduler.shared.submit(request) print("Process notification triggered") } catch { print("Could not schedule background process: \(error)") } } Could anyone share any concerns to my problem? or kindly clarify me why BGProcessingTaskRequest takes time randomly?
4
0
324
Oct ’24
Testing Live Caller ID w/ OHTTP Gateway
Hello there, We are developing our own server for live caller ID service, and we have some questions for end-to-end testing: According to the official documentation, it's said that the OS on user's iPhone will issue OHTTP request to 3rd party's gateway. Is it possible to verify this behavior at local environment, using physical device? If answer to question 1. is no, will Apple provide other beta testing methods? For example via Testflight. Any suggestion helps. Thanks!
0
1
142
Oct ’24
SensorKit Visit Data Inconsistencies Across Devices
Hello, I am currently developing an application using SensorKit to retrieve visit data. While the data retrieval works smoothly on one iPhone (iPhone 14, iOS 18.0.1), it fails on other devices, including: iPhone 15 Pro Max with iOS 18.1 Beta Another iPhone 14 with iOS 18.0 I’ve verified that the entitlements are configured properly, and the app has the necessary SensorKit visit permissions across all devices. Despite these steps, only one of the phones is able to retrieve the visit data correctly. Is there any minimum hardware requirement or compatibility issue with certain models or configurations that I should be aware of for using SensorKit visits? Any guidance or insight would be greatly appreciated! Thank you.
0
0
119
Oct ’24