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

ContactAccessButton and ContactAccessPicker issues
We are trying to adopt the new iOS18 ContactAccessButton and ContactAccessPicker in our app and we are facing below issues and requirements in UI and functionality. is there a way to optionally hide the ContactAccessButton UI when there is no matching results ?. The search button in the ContactAccessButton UI is not working when showing no matches and browse contacts. The console showing below error #ContactsButton response after touch -- Should not show UI #ContactsButton: match for callback was unexpectedly nil? The ContactAccessPicker view and contact selection view opened from ContactAccessButton - view results are not presented properly. The presented view not fully covered the presenting screen and blank screen appears in edges Cancel button in ContactAccessPicker UI when list shown is not working.
4
2
272
Aug ’24
Issue with workoutPreview API - Workouts Not Sending to Apple Watch
Hi everyone, I’m reaching out to see if anyone else has experienced issues with the workoutPreview API. I’ve been trying to get it to send workouts to the Apple Watch, but it’s not working as expected. Even the example code provided in the official documentation fails to do the job. For reference, I’m using the latest stable (non-beta) versions of iOS and watchOS. import SwiftUI import WorkoutKit struct PresentPreviewDemo: View { private let cyclingWorkoutPlan: WorkoutPlan @State var showPreview: Bool = false init() { cyclingWorkoutPlan = WorkoutPlan(.custom(WorkoutStore.createCyclingCustomWorkout())) } var body: some View { Button("Present Cycling Workout Preview") { showPreview.toggle() } .workoutPreview(cyclingWorkoutPlan, isPresented: $showPreview) } } struct PresentPreviewDemo_Previews: PreviewProvider { static var previews: some View { PresentPreviewDemo() } } It used to work but it is not working anymore. Has anyone else run into this problem? Is there a known issue or workaround that I might have missed? I’ve tried everything I can think of, and this is blocking my progress. Any insights or suggestions would be greatly appreciated! Thanks in advance!
2
0
174
4w
Contact Provider Extension contacts in iCloudBackup?
In the documentation for the Contact Provider Extension contact provider it says This allows apps like Phone and Mail to provide personal names and images for incoming calls or messages when your app knows the caller or sender. Instead of adding contacts directly with the Contacts framework, your app provides read-only contact items that it can update, and which the person using the app can easily enable, disable, add, or remove. Contacts stored in Phone/Contacts are getting backed up via iCloudBackup... what about contacts provided via the Contact Provider Extension? Are they also subjected to iCloudBackup, similar to the "regular" contacts? Thanks!
2
1
225
Aug ’24
iOS Safari extensions turning themselves off?
We have an iOS Safari extension currently distributed via Testflight. I’ve noticed that after an indeterminate period of time (sometimes days, sometimes weeks) our safari extension will stop working and will need to be turned on again from the system general -> safari -> extensions menu. This is occurring on both iPhones and iPads running 17.6.1. Is there any condition that will cause the system to disable a safari extension, requiring the user to reopen iOS settings to re-enable?
1
0
166
3w
TipKit: showing a popover tip on a SwiftUI toolbar button
Hi folks, there's currently a known issue in TipKit due to which it won't show popover tips on buttons that are inside a SwiftUI ToolbarItem. For example, if you try this code, the popover tip will not appear: ToolbarItem { Button(action: {...}) { Label("Tap here", systemImage: "gear") } .popoverTip(sampleTip) } There's an easy workaround for this issue. Just apply a style to the button. It can be any style. Some examples are bordered, borderless, plain and borderedProminent. Here's a fixed version of the above code: ToolbarItem { Button(action: {...}) { Label("Tap here", systemImage: "gear") } .buttonStyle(.plain) // Adding this line fixes the issue. .popoverTip(sampleTip) } Hope this helps anyone running into this issue.
9
8
3.7k
Aug ’23
EXC_BAD_ACCESS (SIGSEGV) crash observed in NSDateFormatter APIs
Hi Team, I am using NSDateFormatter to print date and time in my logger class. // Get current date and time NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; NSString *dateTimeString = [dateFormatter stringFromDate:[NSDate date]]; I am using the NSDateFormatter as shown in the above snippet, but I am seeing random crashes with the below stack trace. This crash is random and can't be reproduced consistently. 0 libobjc.A.dylib 0x7ff8051a021d objc_msgSend + 29 1 CoreFoundation 0x7ff8056609ef __CFDateFormatterSetSymbolsArray + 59 2 CoreFoundation 0x7ff80564db87 __ApplyUDateFormatSymbol + 324 3 CoreFoundation 0x7ff80564c854 __ResetUDateFormat + 3064 4 CoreFoundation 0x7ff80564bc30 __CreateCFDateFormatter + 320 5 Foundation 0x7ff8064c2ae3 -[NSDateFormatter _regenerateFormatter] + 323 6 Foundation 0x7ff8064c2858 -[NSDateFormatter stringForObjectValue:] + 297 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018 Exception Codes: 0x0000000000000001, 0x0000000000000018 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [5372] Can someone please suggest if there is something wrong in the way NSDateFormatter being used? I checked the documentation and found nothing that can be causing this issue. Thanks and Regards
2
0
219
Sep ’24
Mac app crashing in CF_IS_OBJC function on macOS Sonoma
I have an Electron app on macOS Sonoma (Intel arch). It has a native addon (app.node) using node-addon-api. Recently it crashed, with the stack trace (given below). What is the CF_IS_OBJC function inside the CFDataGetBytePtr function, and why did it crash there? [NSEvent addGlobalMonitorForEventsMatchingMask:NSEventMaskKeyDown handler:^(NSEvent *event) { // code using CFDataGetBytePtr function }]; [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown handler:^NSEvent *_Nullable(NSEvent *event) { // code using CFDataGetBytePtr function return event; }]; I have key events monitors attached using addGlobalMonitorForEventsMatchingMask and addLocalMonitorForEventsMatchingMask in my native code and they use the CFDataGetBytePtr function there. So I think the issue happened in the key event monitor handler when calling the CFDataGetBytePtr function because my native addon app.node is also present in the trace. Also from the third and fourth entry in the stack trace, it seems like it happened while the app was updating. OS Version: macOS 14.4 (23E214) Report Version: 104 Crashed Thread: 5490 Application Specific Information: Fatal Error: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS / 0x0 Thread 5490 Crashed: 0 CoreFoundation 0x19c970118 CF_IS_OBJC 1 CoreFoundation 0x19c83b280 CFDataGetBytePtr 2 .app.desktop.1inmRz 0x104a5bec0 <unknown> 3 .app.desktop.1inmRz 0x104a57b28 <unknown> 4 app.node 0x104a80a7c [inlined] Napi::details::CallbackData<T>::Wrapper::lambda::operator() (napi-inl.h:117) 5 app.node 0x104a80a7c Napi::details::WrapCallback<T> (napi-inl.h:79) 6 app.node 0x104a80a24 Napi::details::CallbackData<T>::Wrapper (napi-inl.h:112) 7 Electron Framework 0x11472e5e0 v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke (js_native_api_v8.cc:441) 8 <unknown> 0x147e105f8 <unknown> 9 <unknown> 0x1401d0814 <unknown> 10 <unknown> 0x1401d0a9c <unknown> 11 <unknown> 0x147f19368 <unknown> 12 <unknown> 0x147e0aab0 <unknown> 13 <unknown> 0x1401d0e00 <unknown> 14 <unknown> 0x1401d1ac0 <unknown> 15 <unknown> 0x147f19368 <unknown> 16 <unknown> 0x147e0aab0 <unknown> 17 <unknown> 0x1401d1494 <unknown> 18 <unknown> 0x1401d20dc <unknown> 19 <unknown> 0x147e4c1b4 <unknown> 20 <unknown> 0x147f1b5f8 <unknown> 21 <unknown> 0x147e3b754 <unknown> 22 <unknown> 0x147e0b618 <unknown> 23 Electron Framework 0x10ee0c49c v8::internal::(anonymous namespace)::Invoke (simulator.h:178) 24 Electron Framework 0x10ee0d08c v8::internal::(anonymous namespace)::InvokeWithTryCatch (execution.cc:475) 25 Electron Framework 0x10ee0d1e0 v8::internal::Execution::TryRunMicrotasks (execution.cc:576) 26 Electron Framework 0x10ee37364 v8::internal::MicrotaskQueue::PerformCheckpoint (microtask-queue.cc:176) 27 Electron Framework 0x1146cce9c node::InternalCallbackScope::Close (callback.cc:137) 28 Electron Framework 0x1146ccb64 node::InternalCallbackScope::~InternalCallbackScope (callback.cc:92) 29 Electron Framework 0x1147112b4 node::Environment::RunTimers (env.cc:1376) 30 Electron Framework 0x10daf9980 uv__run_timers (timer.c:178) 31 Electron Framework 0x10dafcb3c uv_run (core.c:465) 32 Electron Framework 0x10dc944d4 electron::NodeBindings::UvRunOnce (node_bindings.cc:891) 33 Electron Framework 0x110e2016c base::TaskAnnotator::RunTaskImpl (callback.h:156) 34 Electron Framework 0x110e3cea4 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork (task_annotator.h:89) 35 Electron Framework 0x110e8851c base::MessagePumpCFRunLoopBase::RunWorkSource (message_pump_apple.mm:444) 36 Electron Framework 0x10da7ad7c base::apple::CallWithEHFrame 37 Electron Framework 0x110e876a4 base::MessagePumpCFRunLoopBase::RunWorkSource (message_pump_apple.mm:415) 38 CoreFoundation 0x19c89deac __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 39 CoreFoundation 0x19c89de40 __CFRunLoopDoSource0 40 CoreFoundation 0x19c89dbb0 __CFRunLoopDoSources0 41 CoreFoundation 0x19c89c79c __CFRunLoopRun 42 CoreFoundation 0x19c89be08 CFRunLoopRunSpecific 43 HIToolbox 0x1a7036ffc RunCurrentEventLoopInMode 44 HIToolbox 0x1a7036e38 ReceiveNextEventCommon 45 HIToolbox 0x1a7036b90 _BlockUntilNextEventMatchingListInModeWithFilter 46 AppKit 0x1a00f496c _DPSNextEvent 47 AppKit 0x1a08e6de8 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 48 AppKit 0x1a00e7cb4 -[NSApplication run] 49 Electron Framework 0x110e89244 base::MessagePumpNSApplication::DoRun (message_pump_apple.mm:805) 50 Electron Framework 0x110e87068 base::MessagePumpCFRunLoopBase::Run (message_pump_apple.mm:156) 51 Electron Framework 0x110e3d9a0 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:646) 52 Electron Framework 0x110e05a98 base::RunLoop::Run (run_loop.cc:134) 53 Electron Framework 0x10ffcbcd0 content::BrowserMainLoop::RunMainMessageLoop (browser_main_loop.cc:1094) 54 Electron Framework 0x10ffcd744 content::BrowserMainRunnerImpl::Run (browser_main_runner_impl.cc:158) 55 Electron Framework 0x10ffc964c content::BrowserMain (browser_main.cc:34) 56 Electron Framework 0x10de12aa8 content::RunBrowserProcessMain (content_main_runner_impl.cc:712) 57 Electron Framework 0x10de13b1c content::ContentMainRunnerImpl::RunBrowser (content_main_runner_impl.cc:1299) ...
9
1
915
May ’24
Request eSIM entitlement (*Carrier Team ID)
Hi, I'm developing a app that can install eSIM profile to device within the app, check currently esim or device is support eSIM feature, but for the Core Telephony API that required eSIM entitlement... I trying to request the entitlement from apple, but for the "Carrier team ID", my partner (carrier) does not know about this part... anyone can help? how can i get the "carrier team id" and request to apple get the entitlement to my app, implement Core Telephony...
3
0
629
Jul ’24
Extensions and Widget localizations
Hi community: I'm experiencing an issue in iOS 17 where the Widgets and Extensions use the local device language instead of the app language (preferred languages displayed on the app settings). This issue was reproducible in iOS 16.1, but then was solved. Now it is back on iOS 17 and iOS 17.1 In terms of code, Locale.current in the app returns the language preference selection, even you can use bundle.main.preferredlanguages and get the first one (because there's a repetition from 2 to 3 times the same value) But in whatever extension, the app's preferred language cannot be got, it always returns the system's preferred language. @eskimo, Is it a known issue? Also, Xcode 15.3 shows 0 files localized when you use the strings catalog. I appreciate any help you can provide.
2
0
577
Jun ’24
AppIntents/PerformActionExecutorTask.swift:298: Fatal error: perform() returned types not declared in method signature - Did not declare ReturnsValue but provided one
AppIntents/PerformActionExecutorTask.swift:298: Fatal error: perform() returned types not declared in method signature Did not declare ReturnsValue but provided one func perform() async throws -> some IntentResult&ReturnsValue { let msg = await JDSiriKitShortCutsManager.handleShortCut(type: type ?? .flashLid) // let dialog = IntentDialog.responseSuccess(msg: msg) // return .result(value: msg, dialog: dialog, view: JDSirikitShortCutView(msg: msg)) return .result(value: msg) }
1
1
170
4w
Returning a type from an Intent (basics)
Hello, I'm attempting to learn the basics of AppIntents. My test Hello World intent takes a number and doubles it. This page (https://developer.apple.com/documentation/appintents/providing-your-app-s-capabilities-to-system-services) seems to imply that you can return types from the perform() function. My code compiles, but crashes at runtime with the error perform() returned types not declared in method signature - Did not declare ReturnsValue but provided one Code: struct DoubleANumber: AppIntent { static var title: LocalizedStringResource = "Double a number" static var description = IntentDescription("Given a number, gives back twice that number.") @Parameter(title: "Start Number") var inputNumber: Double static var parameterSummary: some ParameterSummary { Summary("The number to double") } func perform() async throws -> some IntentResult & ReturnsValue { let outputNumber = inputNumber * 2 return .result(value: outputNumber) } } The value returned in the value property of the IntentResult is a Double. I would have assumed that this would be a valid primitive type (as mentioned in the earlier section of that docs page, covering parameters) and that the actual type returned is the wrapper .result type would be covered in the type in the method signature some IntentResult & ReturnsValue What am I missing? Thanks.
2
0
587
Nov ’23
Limitations of AppIntentsExtension member intents
When considering an intent's membership in an AppIntentsExtension vs. main target or an xcframework linked to the main target (with Xcode 16), are there certain capabilities unavailable to Extension member AppIntents? (Specifically, say reuse in AppShortcutsProvider, launching deep links via openAppWhenRun, reuse in Widgets or LiveActivities?) For example, the Watch action button warns to only use intents in the main Watch target.
1
0
230
Aug ’24
iOS 18: CallKit screen briefly enters foreground when accepting the call via Bluetooth headphones
Hello. We are using Twilio Video SDK and CallKit to report an incoming invite to join a video room. We noticed that on iOS 18 beta when accepting the incoming call invite using Bluetooth headphones while the application is in the foreground, the CallKit screen for a moment enters the foreground before going into background. On iOS 17 when the call invite is accepted, the application remains in foreground and the CallKit screen is instantly sent to background. This is not reproducible when using Apple EarPods on iOS 18 with a Lightning connector. This seems like a minor change. But it would be nice to know if this is an intentional change or a possible issue.
1
1
217
Aug ’24
iOS 18: CallKit decline button works only on second try when rejecting a call invite from Twilio Video SDK
Hello. We are using Twilio Video SDK and CallKit to report an incoming invite to join a video room. On iOS 18 beta when the user receives the incoming call invite and taps the CallKit decline button, nothing happens. The incoming call UI is still visible. Only after tapping the decline button a second time the call invite is actually ended. The provider(CXProvider, perform: CXEndCallAction) method is called both times when tapping the decline button twice. Strangely enough, it is also called when tapping the accept button on iOS 18. This is working fine on iOS 17 and there haven't been any recent code changes in the application. Did anyone else encounter a similar issue with CallKit on iOS 18 beta ?
1
1
245
Aug ’24
Non Optional AppIntent Param
After building my app with Xcode 16 beta 6 I'm getting this warning in my AppIntents. Encountered a non-optional type for parameter: computer. Conformance to the following AppIntent protocols requires all parameter types to be optional: AppIntents.WidgetConfigurationIntent, AppIntents.ControlConfigurationIntent The intent looks something like this struct WakeUp: AppIntent, WidgetConfigurationIntent, PredictableIntent { @Parameter(title: "intent.param.computer", requestValueDialog:"intent.param.request_dialog.computer") var computer: ComputerEntity init(computer: ComputerEntity) { self.computer = computer } init() { } public static var parameterSummary: some ParameterSummary { Summary("Wake Up \(\.$computer)") } static var predictionConfiguration: some IntentPredictionConfiguration { IntentPrediction(parameters: (\.$computer)) { computer in DisplayRepresentation( title: "Wake Up \(computer)" ) } } @MainActor func perform() async throws -> some IntentResult & ProvidesDialog { } } According to the docs though specifying optional is how we say if the value is required or not. https://developer.apple.com/documentation/appintents/adding-parameters-to-an-app-intent#Make-a-parameter-optional-or-required So is this warning accurate? If so, how do I specify that a parameter is required by the intent now?
1
7
278
4w
Crash on URLSession in background task
Hi, I try to implement the BackgroundTask handling from this WWDC2022 video: https://developer.apple.com/videos/play/wwdc2022/10142 But it always crashes with this error: *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Completion handler blocks are not supported in background sessions. Use a delegate instead.' So, is the video updated or is this a bug?
3
0
210
Aug ’24
Does "Locked and hidden apps" feature of iOS 18 support deep link?
Our app includes showing external web service with WebView or Safari and returning to the app with custom URL scheme or universal link. When we set "Hide and Require Face ID" feature which was available on iOS 18, neither custom URL scheme nor universal link activated the app. If we only set "Require Face ID", the deep link worked properly. Here is what we've tried: Define custom URL scheme or universal link in the app https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app Implement external web service with one of the following frameworks ASWebAuthenticationSession https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/ SFSafariViewController https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller Safari WKWebView https://developer.apple.com/documentation/webkit/wkwebview On iOS 18 device, install the app and set "Hide and Require Face ID" Access external web page and tap the link which activates custom URL scheme or universal link We expected the deep link to work, but the results were: Custom URL scheme & ASWebAuthenticationSession/SFSafariViewController/Safari The system shows "Cannot open the page because the address is invalid" Custom URL scheme & WKWebView Nothing happens when tapping the link Universal link Directed to the server with associated domain file, but the system doesn't call the app which is defined in the associated domain file We tested the feature with the app built with Xcode16 beta 6, and the device with iOS 18 Seed 8(22A5350a). Does hide app feature support custom URL scheme and universal link?
1
2
537
Sep ’24
URLRepresentableEntity with custom properties
I am trying to implement URLRepresentableEntity on my AppEntity I am following along with the WWDC video here All compiles fine when I use the ID as in the video: extension SceneEntity: URLRepresentableEntity { static var urlRepresentation: URLRepresentation { "https://example.com/scene/\(.id)" } } but my URLs need to use a different property on the Entity. The WWDC video clearly states: "Notice that I'm using the entity’s identifier as an interpolated value. You can use an entity’s ID or any of its properties with the @Property attribute as interpolations in the URL string." So I annotated my entity with the @Property attribute and expected that to work but it doesn't compile. struct SceneEntity: AppEntity { let id: UUID @Property(title: "Slug") var slug: String } extension SceneEntity: URLRepresentableEntity { static var urlRepresentation: URLRepresentation { "https://example.com/scene/\(.slug)" } } Type 'EntityURLRepresentation.StringInterpolation.Token' has no member 'slug' How can I use this API with a property that is not the ID?
0
0
235
4w