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

Apple sign in fail "Sign Up Not Completed"
Something seems to be wrong in the Apple Sign In modal. After pressing the Continue button and going through Face ID, it displays Sign Up Not Completed and does not proceed. This was working fine a few days ago, but then I had to download a new provisioning profile and now it is broken. There are no errors in the log when this happens, but when I close the sign in modal it logs: [core] Authorization failed: Error Domain=AKAuthenticationError Code=-7003 "(null)" The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1001.) Please help! I even spun up a fresh new project and made new ID / Provisioning profile and this error is still happening. Thanks!
3
2
1.5k
Feb ’22
webNavigate doesn't work in safari web extension with tabs.update
I am trying to write a safari web extension that redirects users to Y URL if they type X URL without ever loading the X URL. The piece of code that I have attached below works smoothly on chrome, but not on safari. background.js function onBeforeNavigate(event) { const redirectURL = "https://google.com/" chrome.tabs.update(event.tabId, { url: redirectURL }) } chrome.webNavigation.onBeforeNavigate.addListener(onBeforeNavigate,{ url: [ {urlMatches: "https://girlcodeit.com/*"}, {urlMatches: "http://girlcodeit.com/*"} ] }) manifest.json "manifest_version": 2, "name": "", "description": "", "version": "1.0", "background": { "scripts": [ "background.js" ] }, "permissions": [ "webNavigation", "tabs" ] } I have tried writing browser.tabs.update and just tabs.update in place of chrome.tabs.update in safari version, no change. I want to achieve the redirection anyhow through a safari web extension, please suggest changes in this one or share any other approaches. webRequestBlocking is not supported by Safari, so that doesn't work either.
3
2
1.5k
Feb ’22
missing com.apple.developer.family-controls / Missing Family Controls from provisioning profile
With "Automatically Manage Signing" enabled in Signing & Capabilities I got a message when uploading to the App Store complaining that my provisioning profile was missing Family Control capabilities. I do have the capability enabled in XCode, and I can deploy directly to devices to see that the app works correctly (that is, it has the capability). Further, I can see the same capability checked in the App Id under my developer profile. Further, if I generate a profile manually it claims to include Family Controls in the info screen. But still it won't let me upload the app. I've tried: deleting all automatically generated profiles and regenerating them. adding and removing the capability in Xcode and in the App Id generating a manual provisioning profile and downloading it (this one complains about the missing capability when I download it). Any ideas?
20
2
7.4k
Mar ’22
Set 12 vs 24 hour with the new date formatting API in iOS 15
Using the new date formatting API available in iOS 15, I would like to respect the 12 vs 24 hour setting on a user-by-user basis. With DateFormatter it can be done as follows, for example, to force a 24 hour time irrespective of the user locale. let formatter = DateFormatter() formatter.dateFormat = "HH:mm" // or hh:mm for 12 h However, I cannot figure out how to force the new date formatting API in iOS 15 to do the same thing, i.e. force displaying 12 vs 24 h. I'm using a format style like this: var formatStyle = dateTime formatStyle.calendar = calendar if let timeZone = timeZone { formatStyle.timeZone = timeZone } return formatStyle And applying it like this, for example, for a given Date instance: date.formatted(formatStyle.hour(.defaultDigits(amPM: .abbreviated))) However, this seems to always give a formatted string relevant to the locale, for example, it's always 12h for the US and always 24h for the UK. This is not the behaviour I really need though, and I'd like to allow each individual user to control what they see irrespective of the locale setting. (Note that there is an in-app setting that allows the user to toggle between the 12 and 24 hour preference, which is the value I'd like to use to set the preference.)
7
0
8.3k
Mar ’22
Custom Intent Resolve Methods Not Called in Correct Order
According to the WWDC19 video (Introducing Parameters for Shortcuts), the parameters are supposed to be resolved in the order you have placed them in the Intents Definition file in Xcode (see timestamp 13:02 through 13:16). In my objective C implementation, this is not happening. I deleted the derivedData and clean the build file, but that did not help. Here is a screenshot of my intents definition parameters: In my implementation, it seems to first process the parameters that do not have "Dynamic Options" check. Then it circles back and works on the ones that have "Dynamic Options". So in my case, it starts with partName, quantity, dimensions, thickness, width, and length. Then it works on partsListName. Furthermore, while the "Disambiguation Prompt" is spoken/written, the "Disambiguation Introduction" is NOT spoken/written. Is this a bug that is causing the parameters to be resolved in the wrong order, or do I need to do something differently to force it to resolve parameters in the order that I need it to go in? And are the "Disambiguation Introduction" supposed to work?
3
0
1k
Mar ’22
Unable to launch app from CarPlay
Hi, I have a media app that works fine when it is launched from the phone and the menu buttons work perfectly. However the reverse scenario does not work i.e. if the app is not launched on phone but the App icon shows up on the screen - clicking on the icon does not launch the app. Any ideas what could be going on? Thanks
3
0
799
Mar ’22
Problem decoding AttributedString containing emoji
I am trying to encode an AttributedString to JSON and then decode it back to an AttributedString. But when the AttributedString both (1) contains emoji, and (2) has any attributes assigned, the decoding seems to fail, producing a truncated AttributedString. By dump-ing the decoded value, I can see that the full string is still in there (in the guts property) but it is missing in normal uses of the AttributedString. Below is an example that reproduces the problem. import Foundation // An arbitrary AttributedString with emoji var attrString = AttributedString("12345💕☺️💕☺️💕☺️12345") // Set an attribute (doesn't seem to matter which one) attrString.imageURL = URL(string: "http://www.dummy.com/dummy.jpg")! // Encode the AttributedString var encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted let data = try! encoder.encode(attrString) // Print the encoded JSON print("encoded JSON for AttributedString:") print(String(data: data, encoding: .utf8)!) // Output from above omitted, but it looks correct with the full string represented // Decode the AttributedString and print it let decoder = JSONDecoder() let decodedAttrString = try! decoder.decode(AttributedString.self, from: data) print("decoded AttributedString:") print(decodedAttrString) // Output from above is a truncated AttributedString: // // 12345💕☺️ { // NSImageURL = http://www.dummy.com/dummy.jpg // } print("dump of AttributedString:") dump(decodedAttrString) // Interestingly, `dump` shows that the full string is still in there: // // ▿ 12345💕☺️ { // NSImageURL = http://www.dummy.com/dummy.jpg // } // ▿ _guts: Foundation.AttributedString.Guts #0 // - string: "12345💕☺️💕☺️💕☺️12345" // ▿ runs: 1 element // ... //
9
0
1.2k
Apr ’22
Error enabling extension Caller ID
I have an app which uses the Call Directory Extension to identify callers. It has been downloaded a few hundred times and a small percentage of users are reporting this error. They are logged in to the app but when they go to phone -> settings -> call blocking & identification they get one of two error messages. "An error occurred while attempting to enable app." "Failed to request data for app. You may try enabling the extension again and if the problem persists contact the application developer." I'm not sure how this could be an issue with the app because it works for the majority of users. Furthermore users still experience the error when I ask them to log in with a test account. One user even reported that they could enable it in settings but a little while later it will disable itself. I have seen similar posts where it's been suggested that the error may be due to bad data (out of order, duplicate contacts, etc) but this error shows before the app even begins to load the data. Does anyone know under what conditions this error popup shows? Many thanks
4
1
2.3k
Apr ’22
How Can I run an automation on SMS messages that are coming from my Bank
I would like to perform certain actions when I receive messages from the Bank. There is an option in shortcuts to run the automation when receiving messages from certain contacts. The problem is that I can't store the bank in my contacts as they do not have a phone number or something. I want to achieve this goal in any possible way. What I have tried is to store - their contact - in my contacts so that I will be able to set up the automation. When I tried to store iPhone just shows me the prompt to create a contact with NO values whatsoever. SO it will just be an empty contact. Any ideas how on how I can achieve that?
3
2
2.5k
May ’22
HAP specification too strict for horizontal awning
Many customers of horizontal awnings complain that the logic is reversed. When the awning is extended it shows as closed and vice versa. When people talk or describe the state of the awning we say 'open' to extend and 'close' to retract. There are examples of people using it in scenes, or using Siri to ask to close all shutters and awnings, only to find the awnings fully extended the next morning after heavy rain. The overall status will also show the awnings 'Open' while they are not in use. This is all very annoying and confusing. There doesn't seem to be a difference in language between English and French, Dutch, German, ... when describing the operation of an awning. One can quickly find videos and instructions on operating awnings when 'open' refers to extending the horizontal coverage and 'closing' refers to retracting the horizontal coverage. Somfy (a manufacturer of motors for awnings and the Tahoma Switch = HomeKit Bridge) on their part claim that they cannot resolve this issue as they need to follow the HAP specification in order to pass HomeKit certification. This characteristic describes the current position of accessories. This characteristic can be used with doors, windows, awnings or window coverings. For windows and doors, a value of 0 indicates that a window (or door) is fully closed while a value of 100 indicates a fully open position. For blinds/shades/awnings, a value of 0 indicates a position that permits the least light and a value of 100 indicates a position that allows most light. -HAP specification 9.27 Current Position This is where Somfy points to with the claim they are obliged to use value '100' when it's fully retracted (closed, reported as open in HomeKit) and '0' when it's fully extended (open, reported as closed in HomeKit). Is this indeed a problem in the spec (i.e. should an awning's current position be determined like windows/doors?) or would Apple allow a manufacturer to interpret the spec according to what the user is expecting without loosing certification?
8
4
2.0k
May ’22
PencilKit custom tool
Hi, can i create custom tool for PKToolPicker? On documentation page on PKTool says "Don’t adopt this protocol in your own objects. Instead, create a tool object to provide users with the desired the tool behavior." Best regards, Matej Klemen
1
1
767
May ’22
SecureCoding roadblock?
Attached is an entire project (4 files) that mirrors my actual project including the failure to save to file. Am I: missing some syntax in this code? failing to config a defaults file? not set the necessary parameters in " "Build Settings" or "Build Rules etc.? I was writing to JSON files, but now that I must append to files directly, and JSON doesn't do that easily, I am trying to write using native macOS tools. WELL, IT SEEMS I CAN'T SEND YOU THE CODE, TOO MANY CHARS. I CAN'T ATTACH ANY FILE EITHER. WHY OFFER IT IF IT IS NOT ALLOWED? ANYWAY, CAN YOU GLEAN ANYTHING FROM THIS... Thanks. My debugger area: 2022-05-28 12:03:11.827372-0500 exampleClassInClassSecureCoding[1508:29981] Metal API Validation Enabled 2022-05-28 12:03:11.940123-0500 exampleClassInClassSecureCoding[1508:29981] *** NSForwarding: warning: object 0x600003cf7090 of class 'exampleClassInClassSecureCoding.classOne' does not implement methodSignatureForSelector: -- trouble ahead Unrecognized selector -[exampleClassInClassSecureCoding.classOne replacementObjectForKeyedArchiver:] 2022-05-28 12:03:11.940416-0500 exampleClassInClassSecureCoding[1508:29981] Unrecognized selector -[exampleClassInClassSecureCoding.classOne replacementObjectForKeyedArchiver:] Unrecognized selector -[exampleClassInClassSecureCoding.classOne replacementObjectForKeyedArchiver:] Performing @selector(didPressButton:) from sender _TtC7SwiftUIP33_9FEBA96B0BC70E1682E82D239F242E7319SwiftUIAppKitButton 0x7ff08ab06480
9
0
1.5k
May ’22
Networking Resources
General: TN3151 Choosing the right networking API Networking Overview document — Despite the fact that this is in the archive, this is still really useful. TLS for App Developers DevForums post Choosing a Network Debugging Tool documentation WWDC 2019 Session 712 Advances in Networking, Part 1 — This explains the concept of constrained networking, which is Apple’s preferred solution to questions like How do I check whether I’m on Wi-Fi? TN3135 Low-level networking on watchOS Adapt to changing network conditions tech talk Foundation networking: DevForums tags: Foundation, CFNetwork URL Loading System documentation — NSURLSession, or URLSession in Swift, is the recommended API for HTTP[S] on Apple platforms. Network framework: DevForums tag: Network Network framework documentation — Network framework is the recommended API for TCP, UDP, and QUIC on Apple platforms. Network Extension (including Wi-Fi on iOS): See Network Extension Resources Wi-Fi Fundamentals Wi-Fi on macOS: DevForums tag: Core WLAN Core WLAN framework documentation Wi-Fi Fundamentals Secure networking: DevForums tags: Security Apple Platform Security support document Preventing Insecure Network Connections documentation — This is all about App Transport Security (ATS). Available trusted root certificates for Apple operating systems support article Requirements for trusted certificates in iOS 13 and macOS 10.15 support article About upcoming limits on trusted certificates support article Apple’s Certificate Transparency policy support article Technote 2232 HTTPS Server Trust Evaluation Technote 2326 Creating Certificates for TLS Testing QA1948 HTTPS and Test Servers Miscellaneous: More network-related DevForums tags: 5G, QUIC, Bonjour On FTP DevForums post Using the Multicast Networking Additional Capability DevForums post Investigating Network Latency Problems DevForums post Local Network Privacy FAQ DevForums post Extra-ordinary Networking DevForums post Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
2.2k
Jun ’22
Hourly history with WeatherKit REST API
Has anyone figured out the correct incantation of request parameters to get historic hourly weather conditions from WeatherKit? I've tried every combo of hourlyStart, dailyStart, currentAsOf, etc with past dates and it seems like the oldest it will go back to is midnight for today. I would like to get the last 24 hours of conditions.
11
4
4.8k
Jun ’22
create memoji programatically
Does apple expose any apis to manipulate a Memoji programatically? I find Apple's way of creating memojis extremely unpleasant to use - and would like to create an alternative. So I'd essentially be looking at some way of listing the parameters available (eye colour, hair style etc) - listing the set of choices for each parameter, and producing a Memoji from a set of parameters. (And for extra credit, taking a picture of said memoji, or reading an existing emoji as a set of parameters). Thanks, Darren
1
0
1.5k
Jun ’22
Universal Links Stops Working Randomly
Universal links stops working randomly, When i tried this curl API test i found strange result Case 1: When the curl test return association JSON response it works fine Case 2: Sometimes the curl test fails and association JSON response is not returned for the same log is below: (Actual domain is replaced by mydomain.com) Https enabled No redirections Association added in .well-known folder Works randomly without any change in sever IP added as exception in blacklist Applebot added as: User-agent: Applebot Allow: /.well-known/ Curl API Test Response: Using Terminal: curl -v https://app-site-association.cdn-apple.com/a/v1/mydomain.com *  Trying 8.241.155.124:443... * Connected to app-site-association.cdn-apple.com (8.241.155.124) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/cert.pem * CApath: none * (304) (OUT), TLS handshake, Client hello (1): * (304) (IN), TLS handshake, Server hello (2): * (304) (IN), TLS handshake, Unknown (8): * (304) (IN), TLS handshake, Certificate (11): * (304) (IN), TLS handshake, CERT verify (15): * (304) (IN), TLS handshake, Finished (20): * (304) (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384 * ALPN, server accepted to use http/1.1 * Server certificate: * subject: CN=app-site-association.cdn-apple.com; OU=management:idms.group.5707244; O=Apple Inc.; ST=California; C=US * start date: Sep 1 20:44:29 2021 GMT * expire date: Oct 1 20:44:28 2022 GMT * subjectAltName: host "app-site-association.cdn-apple.com" matched cert's "app-site-association.cdn-apple.com" * issuer: CN=Apple Public Server RSA CA 12 - G1; O=Apple Inc.; ST=California; C=US * SSL certificate verify ok. > GET /a/v1/mydomain.com HTTP/1.1 > Host: app-site-association.cdn-apple.com > User-Agent: curl/7.79.1 > Accept: */* >  * Mark bundle as not supporting multiuse < HTTP/1.1 404 Not Found < Date: Tue, 28 Jun 2022 06:51:03 GMT < Content-Type: text/plain; charset=utf-8 < Content-Length: 10 < Connection: keep-alive < Apple-Failure-Details: {"cause":"context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} < Apple-Failure-Reason: SWCERR00301 Timeout < Apple-From: https://mydomain.com/.well-known/apple-app-site-association < Apple-Try-Direct: true < Cache-Control: public, max-age=1800 < Expires: Tue, 28 Jun 2022 06:51:23 GMT < X-Cache: MISS < CDNUUID: 2478cf3a-1d35-4870-ae61-0ad342ef8adf-1481196180 < CDN-Server: lumn < Age: 1238 <  Not Found * Connection #0 to host app-site-association.cdn-apple.com left intact Please support, Urgent Help Required.
10
1
1.6k
Jun ’22
App Clip iMessage Sharing Not Working
We have been having problems with our app clip not working when sharing through iMessage. The app and app clip are published and work correctly when scanning a QR code that points to the URL: https://www.coderus.com/locations?loc=1 however if this same URL is shared through the iMessage app, a link to the website displays and not the app clip card. We have confirmed that: AASA file is available and has the type application/json Both devices are above iOS 14 Both devices are in each other's contacts The website has the meta tag for the smart app clip banner The website has a meta tag for the og:image Launch experiences have been configured on AppStoreConnect - as said before, the QR codes work correctly The link leads to a 404 page, I wasn't sure if there needs to be an actual page that the link points to as app clips seem to work fine without when scanning the QR code through the camera app.
1
1
881
Jun ’22
How to handle IPv6 link-local addresses in iOS 16?
Our (legacy) code to communicate with peripherals on local IPv6 networks (LAN) adds the zone identifier / interface name ("%en0") to link-local IP addresses (FE80::/10) discovered via SSDP. SSDP is implemented using CocoaAsyncSocket - yes, that part of our code is old... (from before the introduction of the iOS 12+ Network framework). We use these modified IP addresses as the host component of a URL in a URLSession.dataTask. To insert the zone identifier we are using URLComponents (we modify the host and then request the string). This worked fine in iOS 15 and below, but no longer works in iOS 16 (Beta 1/2/3); the host is empty after inserting %en0 in the most recent beta. We have reported this via FB10549269, but from the answer it is unclear to me whether Apple is planning to fix this ("Resolution: Potential fix identified"), or we are doing it wrong. How should we handle IPv6 link-local addresses in iOS 16? (when using URLSession instead of Network) PS: We recently dropped support for iOS 12, but we still need to support iOS 13 and up
3
0
1.8k
Jul ’22
Weather Kit is not returning historical data
I'm trying to get historical data using the following syntax: try await service.weather(for: location, including: .daily(startDate: past1, endDate: past2)) Where past1 and past2 are two dates in the past (I checked their format and they are correct). I always get the same result, namely the 10 days default forecast you usually get calling service.weather(for: location) Am I missing something?
4
3
1.5k
Jul ’22