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.

Posts under General subtopic

Post

Replies

Boosts

Views

Created

How to disable Live Activity on Apple Watch while keeping it enabled on iPhone?
I'm using Live Activity features in my app, but I want to customize the user experience across different Apple devices. Specifically, I'd like to: Keep Live Activity enabled and functioning on the iPhone Disable or prevent Live Activity from appearing on the connected Apple Watch Is this level of device-specific control possible with Live Activity? If so, what's the best approach to implement this functionality? What I've tried: I've looked through Apple's documentation on Live Activity, but couldn't find specific information about device-level control. I've experimented with ActivityKit, but haven't found a clear way to distinguish between iPhone and Apple Watch when pushing updates.
4
0
1.3k
Oct ’24
Detecting if mac is screen sharing
Hi, I am trying to determine if the Mac that is running my app has an active screen sharing session or not. Is there a way to detect this? Potentially using system API's or a system command? Any help would be greatly appreciated, thank you!
2
0
414
Oct ’24
CarPlay issues
I am also currently having the same issue after updating to IOS18 And iPhone 16pro max Whether wired or wireless sound quality is poof and very mono. At some point it corrects itself then you touch the phone screen then back to mono again. Making phone calls big issue. Nothing respond,nothing else resolve it. My Bluetooth works fine. Please fix this… so tired of this
1
0
471
Oct ’24
Siri not picking up app intent
Hello, I have written the following app intent and I can access it via shortcuts. But I can't get Siri to pick it up. I want it to have a dynamic book title (which could be anything) so that the user can say "Add (bookname) to my (app name). I need it to work for ios 17.1 onwards. I have added siri as a capability for my ios app. import AppIntents struct AddBookToReadingListIntent: AppIntent { static var title: LocalizedStringResource = "Add my Book" @Parameter(title: "Book Title", requestValueDialog: "What's the title of the book you want to add?") var bookTitle: String static var parameterSummary: some ParameterSummary { Summary("Add my '\(\.$bookTitle)'") } func perform() async throws -> some IntentResult & ReturnsValue<String> { return .result(value: "Added '\(bookTitle)' to your app") } } struct AppShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: AddBookToReadingListIntent(), phrases: [ "Add \(\.$bookTitle) in \(.applicationName)" ], shortTitle: "Add Book to app name", systemImageName: "book" ) } }
2
0
624
Oct ’24
NSDirectoryEnumerator returns nil
I'm trying to display my images in a tableView, I'm using NSFIleManager and NSDirectoryEnumerator to get all files in the current folder: NSString *path = @"/Users/eagle/Documents/avatars"; NSFileManager *fileManager = NSFileManager.defaultManager; NSDirectoryEnumerator *directoryEnum = [fileManager enumeratorAtPath:path]; NSString *file; while (file = [directoryEnum nextObject]) { // ... } the problem is that this line file = [directoryEnum nextObject] always returns nil, what gives? I already made sure that this folder has no subfolders and contains only images, so what's the problem here?
4
0
639
Oct ’24
Command to open Privacy & Security page in System Settings on Security section
Hello, I'm trying to add a working shortcut to my app that will open a Privacy & Security page in System Settings under Security section where prompts to allow system extension appears. Typically open x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension from the Terminal only open the Privacy & Security page. I want to emulate the button from this system window.
1
0
542
Oct ’24
Music Kit HTML Embeds move an 490 px and below
Apple provides HTML Embeds for Music Kit JS, as mentioned here. There is a tool here that you can use to create embeds. Scroll to Preview Player. Now, if you set your browser width to less than 490 (right when the thumbnail gets smaller), the player will move vertically if you drag up. Not by much, it's hard to see without a contrasting background.. It's more noticeable in dark mode, as a white background shows clearly, like this: I'm misusing "drag" here: a simple, vertical scroll will cause this. Since this happens on Apple's own site, I'm fairly certain that this is not a "me problem," but who knows! Anyhow, I'm not sure if anyone has come across this. These embeds are pretty handy, and I'm loathe to roll my own player just to fix this. Any constructive advice would be appreciated.
2
0
518
Oct ’24
After iOS18.0 rejects the call, CXCall's hasConnected is YES, which should be NO.
Dear Apple R&D Team, I want to report a bug of CallKit caused by Voicemail in iOS18.0. The following are the header files referenced by our code: #import <CallKit/CXCallObserver.h> #import <CallKit/CXCall.h> Our VoIP app uses the callObserver callback function provided by CXCallObserverDelegate to monitor changes in the system phone status (see the attached picture). The problems we encountered are: Before upgrading to iOS18.0, when we rejected a call, we would receive a callObserver callback, and the status value of hasConnected of CXCall was NO; After upgrading to iOS18.0, when we also rejected a call, the status value of hasConnected of CXCall was YES. So we checked the new features of iOS18.0 and found that it was the influence of the new feature Voicemail. On iOS18.0 devices, if you reject a call, you will enter the Voicemail state by default, which means that I rejected the call, but callObserver told me that the call was connected, which is inconsistent with the user's intuitive experience and will also cause our App to respond incorrectly (cannot resume audio automatically). In fact, the Voicemail function is enabled by default for devices upgraded to iOS 18.0. After I reject a call, I have to wait for the caller to hang up before I can receive callObserver telling me that the call has been hung up. This experience is very bad, because when the caller does not hang up the call, our App cannot sense that I have hung up the call and thinks that I am still on the call, but in fact I did hang up the call. Please refer to the code in the attached picture. According to our understanding, the status should flow like this: When I receive an incoming call, the callObserver callback will trigger, call.hasConnected is NO and call.hasEnded is NO; When I reject the call and switch to Voicemail, the callObserver callback will trigger, call.hasConnected should be NO and call.hasEnded should be YES; When I manually restore the call through Voicemail, the callObserver callback will trigger, call.hasConnected should be YES and call.hasEnded should be NO; When the caller or I finally hang up the call, the callObserver callback will trigger, call.hasConnected is YES, call.hasEnded is YES; However, the current status is as follows: When I receive an incoming call, the callObserver callback will trigger, call.hasConnected is NO and call.hasEnded is NO; When I reject the call and switch to Voicemail, the callObserver callback will trigger, call.hasConnected is YES and call.hasEnded is NO; When I manually restore the call through Voicemail, the callObserver callback will not trigger; Only when the caller finally hangs up, the callObserver callback will trigger, call.hasConnected is YES and call.hasEnded is YES; Our request is very simple. We need to pause audio when a call comes in and resume audio when the call is hung up or rejected. This is our sample code: - (void)callObserver:(CXCallObserver *)callObserver callChanged:(CXCall *)call API_AVAILABLE(ios(10.0)) { bool pause_audio = false; BOOL calling = !call.onHold && !call.hasConnected && !call.hasEnded; BOOL disconnected = !call.onHold && !call.hasConnected && call.hasEnded; BOOL connected = !call.onHold && call.hasConnected && !call.hasEnded; BOOL hang_up = !call.onHold && call.hasConnected && call.hasEnded; if (calling) { xc_log(XC_LOG_INFO, "A phone call is %s", call.outgoing ? "outgoing" : "incoming"); pause_audio = true; } else if (disconnected) { xc_log(XC_LOG_INFO, "An %s phone call has been disconnected", call.outgoing ? "outgoing" : "incoming"); // action of phone call end, resume audio } else if (connected) { xc_log(XC_LOG_INFO, "An %s phone call has just been connected", call.outgoing ? "outgoing" : "incoming"); pause_audio = true; } else if (hang_up) { xc_log(XC_LOG_INFO, "An %s phone call has been hang up", call.outgoing ? "outgoing" : "incoming"); // action of phone call end, resume audio } else { xc_log(XC_LOG_INFO, "Unknown telephony state occured"); } if (pause_audio) { dispatch_async(dispatch_get_main_queue(), ^{ // action of phone call begin, pause audio }); } } I would appreciate any help !!!
0
2
501
Oct ’24
App Clips constructPayload API
I'm trying to send an API call to generate the payload for an App Clips Rich Link in Apple Messages. My request has header and body like in the description in the image, and in the authorization header I have a valid secret and fresh iat stamp. but the request returns 403 forbidden status. Did it happend to anyone? Can some one point me to the problem? https://register.apple.com/resources/messages/msp-rest-api/construct-payload
0
0
153
Oct ’24
Requesting support for Bugs related to ScreenTime API
Hello Apple Developer Community, We're developing a parental control app using Apple's ScreenTime API and Family Sharing capabilities. We've encountered several persistent issues that are affecting our users' experience. We've found similar reports from other developers, suggesting these might be widespread problems. We're hoping to get some insight or solutions from the community or Apple experts. Issues we're facing: Parent apps visible on child's device: After granting Family Sharing permission on the family picker, sometimes the parent's apps are visible instead of the child's apps. Related issue: https://forums.developer.apple.com/forums/thread/749672 Inconsistent app visibility on family picker:* The behaviour of the family picker is unpredictable: Sometimes, no apps are visible at all, only categories. Other times, categories are displayed and upon selection, enforcement works correctly. In some instances, the stream delivering updates to the selection from the app extension doesn't send anything. Related issue: https://forums.developer.apple.com/forums/thread/729198 Rules not enforced with different OS versions: When the parent and child devices are running different iOS versions (both above iOS 16), ScreenTime rules don't seem to work correctly. General inconsistencies: We've observed various other inconsistencies in the behavior of the ScreenTime API. These issues are less predictable but contribute to an overall unreliable user experience. Steps to Reproduce: Add a child device using a parental control app (in our case, Adora for Kids). Grant the Family Sharing permission. Open the family picker to set up ScreenTime rules. Observe the inconsistent behaviour: a. Sometimes no apps are visible. b. Sometimes only categories are visible. c. Sometimes both categories and apps are visible. When categories are visible, select a category and attempt to enforce a rule. Enforce a ScreenTime rule. Ensure the parent and child devices are running different iOS versions (both iOS 16+). Test various ScreenTime rules and observe their enforcement across different device configurations. Questions: Are these known issues with the ScreenTime API? What could be causing the inconsistent behavior in the family picker and the stream of updates from the app extension? Are there any workarounds or best practices to mitigate these problems? Is there any additional information we can provide to help investigate these issues? Are there any plans to improve the stability and consistency of the ScreenTime API in future iOS releases? We've tried researching these issues through various channels, including Apple's documentation and community forums, but haven't found definitive solutions. Any insights or assistance would be greatly appreciated. Thank you for your time and help! Environment: Development: Xcode 15.4, macOS 14.2.1 Runtime: iOS 16+ App: Adora (App Store ID: 1671825554)
2
1
365
Oct ’24
Universal Links not working with International Domain Names?
Hello there! My problem concerns Universal Links: My website is https://www.xn--voil-3na.app/ and has a proper apple-app-site-association set, which is validate by all validators, and also well cached on Apple side. (requested with curl https://app-site-association.cdn-apple.com/a/v1/xn--voil-3na.app) My app is voilà and : My provisioning profile allows Associated Domains I can see the associated domains is well defined to xn--voil-3na.app on XCode My AppID and bundle (in the entitlements) are matching the ones on my apple-app-site-association After having made all the debugs following the docs, i'm wondering if the problem doesn't come from my international domain name. Really looking forward some help, as my application is growing (really) fast and I'd like to serve this feature to my users... Sincerly, AB from voilà
4
0
503
Oct ’24
Can MailKit be used to manage existing messages?
I would like to create a MailKit extension that will allow me to manage my existing messages. I would like to move them around form folder to folder and reqad and update their headers to store some metadata that will be used by the extension. Looking at the documentation for MailKit suggests that I can only implement 4 types of handlers (content blocker, action handler, compose handler and security handler). I can’t see anything in the docs about being able to get a list of messages in the inbox and manipulate them. Am I missing something? I’d love to hear from someone who knows more about this topic before I get into a dead-end rabbit hole. cheers, -tomek
1
0
578
Oct ’24
[iOS18]My apps do not appear in the shortcut apps.
It is no longer displayed as a target for shortcut app actions. It was displayed until iOS 17.7. Tried with iOS 18.0 and 18.0.1 but it does not appear. Shortcuts created when under iOS 18 work fine. Only INPlayMediaIntent is supported and is targeted at iOS 15 and above, so no Extension is used and is handled directly in the app. Is anyone else suffering from the same problem?
1
0
601
Oct ’24
Get Cache error with ActivityKit when reboot App。
We are currently experiencing the following weird issue with our iPhone app. As the title says, NSUserDefaults is losing our custom keys and values when phone is rebooted but not unlocked, and this is happening on a very specific scenario with ActivityKit. Context: We are using the NSUserDefaults in the app to store user data (e.g. username). Issue: An error occurred with no permission to access cached messages after a restart. Scenario: When receiving a Dynamic Island notification, if the phone is restarted, after unlocking the phone and tapping on the Dynamic Island to open the App, all cached information results in an error. Reasons for the error: After restarting the APP, the files are in a locked state. The Dynamic Island proactively invokes the App method. When executing the startup method and retrieving cached messages, an error occurs due to lack of permission. All storage, including files, NSUserDefaults, Keychain, and Plist retrieval, results in errors. The error message is as follows: { "errorCode": "-25308", "errorDesc": "Error Domain=com.samsoffes.sskeychain Code=-25308 "(null)"", "serviceName": "com.qunar.qunarclient8", "account": "iid" } The data returned at this time is in a protected state, [UIApplication sharedApplication].isProtectedDataAvailable. Any help or idea will be truly appreciated :)
0
0
312
Oct ’24
"Waiting for Handoff" Dialog Appearing in iOS 18 App Clip
When opening our App Clip from a Live Activity, the iOS system Handoff alert blocks our app on open. It is reproducible 100% of the time. The description in the system alert is: Waiting for Handoff to {My App}. We never had this issue before and believe it is related to iOS 18. I don't have Handoff enabled anywhere in my app. All uses of NSUserActivity explicitly block handoff userActivity.isEligibleForHandoff = false We have been able to locate this same issue in other iOS apps that use Live Activities and App Clips. Is this an iOS 18 system-level bug?
0
0
478
Oct ’24
Universal link issue
We are encountering an issue with the universal link functionality in our app, which was previously working as expected but has now stopped functioning We have followed all the steps to configure universal links and ensured the necessary settings are in place. The associated domains are enabled within our app's capabilities, with the following domains listed: We have also verified the apple-app-site-association files for both servers, which are accessible via the following URLs: https://app.digiboxx.com/apple-app-site-association These files appear to be correctly formatted according to Apple's guidelines. However, despite this, links such as https://app.digiboxx.com/share/123456 are no longer redirecting to the app. This is a significant issue for our customers, and we would appreciate your help in resolving the matter.
1
0
361
Oct ’24
Optimize watchOS CMSensorDataList parsing
I am trying to parse CMSensorDataList in watchOS. The maximum batch of data is comprised of 30 minutes. The sampling rate is 50Hz, which makes it 90,000 records for 30 minutes. We iterate over each item and finally write the data to a CSV file. As this is a slow processing keeping in view the execution limits of watchOS, the process suspends when app goes to the background. This way, it takes too much time to parse a significant time data. My question is, is there a way we can serialize this CMSensorDataList as a whole and transfer it to the phone using WCSession? Or is there another effective way to achieve this?
0
0
389
Oct ’24