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

Home app unreliable across network with iOS 18 beta and Sequoia beta
I have installed iOS 18 beta on one iPhone and Sequoia beta on one computer. Other phones and computers are running iOS 17 and Sonoma. Siri now frequently responds with "I'm having trouble... " or "Some accessories are not responding . ". I have the Home app's Home page open on my Mac. It alternates between two versions of my HomeKit setup. In one version I have several scenes (Good Morning, Goodnight, Go to work) configured and it shows correctly that some lights are on. In the other version there are no scenes and everything thing is reported as "No Response". The display switches between versions very few minutes. It seems to me that Home is referencing two versions of truth in my network. I have tried turning off the two devices running beta OSs
0
0
46
14h
SwiftData Document-based app produces strange write errors
I have a document app built using SwiftData because frankly I'm too lazy to learn how to use FileDocument. The app's title is "Artsheets," and I'm using a document type that my app owns: com.wannafedor4.ArtsheetsDoc. The exported type identifier has these values: Description: Artsheets Document Identifier: com.wannafedor4.ArtsheetsDoc Conforms to: com.apple.package Reference URL: (none) Extensions: artsheets MIME Types: (none) And the code: ArtsheetsApp.swift import SwiftUI import SwiftData @main struct ArtsheetsApp: App { var body: some Scene { DocumentGroup(editing: Sheet.self, contentType: .package) { EditorView() } } } Document.swift import SwiftUI import SwiftData import UniformTypeIdentifiers @Model final class Sheet { var titleKey: String @Relationship(deleteRule: .cascade) var columns: [Column] init(titleKey: String, columns: [Column]) { self.titleKey = titleKey self.columns = columns } } @Model final class Column: Identifiable { var titlekey: String var text: [String] init(titlekey: String, text: [String]) { self.titlekey = titlekey self.text = text } } extension UTType { static var artsheetsDoc = UTType(exportedAs: "com.wannafedor4.artsheetsDoc") } I compiling for my iPhone 13 works, but then when creating a document I get this error: Failed to create document. Error: Error Domain=com.apple.DocumentManager Code=2 "No location available to save “Untitled”." UserInfo={NSLocalizedDescription=No location available to save “Untitled”., NSLocalizedRecoverySuggestion=Enable at least one location to be able to save documents.}
0
0
50
17h
Previewing your app’s interface in Xcode
// // ContentView.swift // HardApp // // Created by Besleaga Alexandru Marian on 14.06.2024. // import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } // A SwiftUI preview. #Preview { Use of unknown directive '#Preview' // The view to preview. } I'm trying to learn Xcode and got stuck on these error that I receive when trying to apply the macro #Preview, how can declare the directive so I can use it in my own code for the preview it offers ? Kind Regards
1
0
44
19h
Ios18 Hourglass next to my apps
After the upgrade , for some reason now my apps have that hourglass icon next to the app icon and I don’t know how to remove them , the thing is that my limit time list on the settings is empty , did you guys deal with something like that after the upgrade or is any fix to solve it please ? thank you
0
0
42
19h
Screen tome big on ios 18 beta
I recently was allowed to leave family sharing due to age and my parents disabled the screen time function, yet i still have screen time limits on my device, and i am kicked out pf settings whenever attempting to go into tje screen time settings, does anyone know a fix/workaround? (Reseting my phone requires the screen time passcode of which i don’t have.)
2
0
47
21h
Share number from contact/call logs
Hi, I'm trying to implement a way to share a phone number from call logs with my app. I would select the call log entry, then "share contact" and share to my app. I implemented a Share Extension and my application appears in the list of application to share with. How can I list my application in the list of actions below the app icons? When I share with my app, the Share Extension view shows up, but no action is possible: I implemented a button to be able to send the number to my application but the action never fires, is it the correct implementation? How would I implement the sharing of the number with my main app? I tried with a custom url binding but I'm not sure if it is the correct way. My ideal implementation would be that no view show up and my application is immediately launched and the number is pasted. struct ShareView: View { var extensionContext: NSExtensionContext? @State private var contact: CNContact? = nil @State private var error: Error? = nil @State private var multiSelection = Set<String>() @State private var selectedPhoneNumber: String? = nil var body: some View { NavigationStack { VStack() { if let contact = contact { Button(action: submitPhoneNumber) { Text("Submit") .padding() .background(Color.green) .cornerRadius(8) .foregroundColor(.white) } List(contact.phoneNumbers, id: \.self) { phoneNumber in Button(action: { print("Phone number selected: \(phoneNumber.value.stringValue)") self.selectedPhoneNumber = phoneNumber.value.stringValue }) { Text(phoneNumber.value.stringValue) //.padding() .background(self.selectedPhoneNumber == phoneNumber.value.stringValue ? Color.blue : Color.clear) //.cornerRadius(8) .foregroundColor(.black) } } } else if let error = error { Text("Error: \(error.localizedDescription)") } else { Text("Loading...") .onAppear { loadContact() } } } } .padding() .navigationTitle("Number") .toolbar() { Button("Close") { close() } } } func close() { NotificationCenter.default.post(name: NSNotification.Name("close"), object: nil) } private func isButtonActive() -> Bool { return selectedPhoneNumber != nil } private func submitPhoneNumber() { print("Selected phone number: \(self.selectedPhoneNumber ?? "Nothing")") guard let phoneNumber = self.selectedPhoneNumber else { return } guard let extensionContext = self.extensionContext else { return } print("PhoneNumber: \(phoneNumber)") let urlScheme = "callclean://" if let url = URL(string: "\(urlScheme)?phone=\(phoneNumber)") { print(url.absoluteString) extensionContext.open(url, completionHandler: nil) } close() } private func loadContact() { guard let extensionContext = extensionContext else { return } for item in extensionContext.inputItems { if let inputItem = item as? NSExtensionItem { if let attachments = inputItem.attachments { for provider in attachments { if provider.hasItemConformingToTypeIdentifier("public.vcard") { provider.loadItem(forTypeIdentifier: "public.vcard", options: nil) { (data, error) in if let error = error { DispatchQueue.main.async { self.error = error } return } if let data = data as? Data { do { //let contactStore = CNContactStore() let contacts = try CNContactVCardSerialization.contacts(with: data) DispatchQueue.main.async { self.contact = contacts.first } } catch { DispatchQueue.main.async { self.error = error } } } } } } } } } } } Thanks for your guidance.
0
0
14
1d
Ios 18 beta time limit not working properly
i’ve recently updated to ios 18. I previously had a time limits set for instagram on my phone , so if i am past my time limit i could just ignore the time limit and continue using the app, but after upgrading to ios 18, i simply cannot use the app after the 1 hour limit set by me. Sometimes it would open, but without sound. I have tried all the things like turning off downtime ,turning off app and webtime activity , adding the app to always allowed list and so on. still no better. I use an 11 pro max.
0
0
21
1d
Apps Shutting Down
I recently installed IOS 18.0 Beta on my Iphone 14 Pro. Now more and more apps shutting down due to “Critical threat detected…” Apdo notification not working wven though notification is enabled in the settings.
0
0
14
1d
Sequoia Printing Issue
I'm having trouble pinning this down. Application crashes and quits when hitting print in dialogue box. This is true across several applications and file types. I've tried exporting to pdf and printing in Preview with same result.
0
0
28
1d
App crashed with NSInvalidUnarchiveOperationException when run from different target and scheme.
Hi, I'm trying to create a new target duplicated from the main target (cdx_ios) called cdx-ios-dev02. I also made a new scheme called cdx-ios-dev02 It can be built just fine however when I run it, it crashed and it throws this exception: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (cdx_ios.AuthObject) for key (root) because no class named "cdx_ios.AuthObject" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver' This is the class: class AuthObject: NSObject, NSCoding { var accessT1: String = "" var t1Type: String = "bearer" var refreshT1: String = "" var expiresIn: Int = 0 var scope: String = "" var jti: String = "" init(accessT1: String = "", t1Type: String = "bearer", refreshT1: String = "", expiresIn: Int = 0, scope: String = "", jti: String = "") { self.accessT1 = accessT1 self.t1Type = t1Type self.refreshT1 = refreshT1 self.expiresIn = expiresIn self.scope = scope self.jti = jti } convenience init(dic: [String: Any]) { self.init() mapping(dic) } required convenience init(coder aDecoder: NSCoder) { let t1 = aDecoder.decodeObject(forKey: "accessT1") as? String ?? "" let t1Type = aDecoder.decodeObject(forKey: "t1Type") as? String ?? "" let refreshT1 = aDecoder.decodeObject(forKey: "refreshT1") as? String ?? "" let expiresIn = aDecoder.decodeInteger(forKey: "expiresIn") let scope = aDecoder.decodeObject(forKey: "scope") as? String ?? "" let jti = aDecoder.decodeObject(forKey: "jti") as? String ?? "" self.init( accessT1: t1, t1Type: t1Type, refreshT1: refreshT1, expiresIn: expiresIn, scope: scope, jti: jti ) } func mapping(_ dic: [String: Any]) { accessT1 = ParseUtil.dictionaryValue(dic, "access_token", "") t1Type = ParseUtil.dictionaryValue(dic, "token_type", "bearer") refreshT1 = ParseUtil.dictionaryValue(dic, "refresh_token", "") expiresIn = ParseUtil.dictionaryValue(dic, "expires_in", 0) scope = ParseUtil.dictionaryValue(dic, "scope", "") jti = ParseUtil.dictionaryValue(dic, "jti", "") } func encode(with nsCoder: NSCoder) { nsCoder.encode(accessT1, forKey: "accessT1") nsCoder.encode(t1Type, forKey: "t1Type") nsCoder.encode(refreshT1, forKey: "refreshT1") nsCoder.encode(expiresIn, forKey: "expiresIn") nsCoder.encode(scope, forKey: "scope") nsCoder.encode(jti, forKey: "jti") } } It worked fine on the original target, cdx-ios. Can anybody help me? Thank you.
2
0
57
1d
Do Universal Links work when the link is wrapped by another link?
Hello, I work for an email marketing company where we send emails through SendGrid. The links go to ebay.com. SendGrid will wrap the links for click tracking purposes, so instead of the link appearing as https://www.ebay.com, it will be something like https://u99798501.ctc.sendgrid.net/... which will then redirect to eBay. We've noticed that when clicking on these SendGrid-tracked links that redirect to eBay, the links do not open in the eBay app, even though we have the eBay app installed. They will instead open up in Safari. Clicking on the https://www.ebay.com links without the wrapping will open in the links in the eBay app. This makes me think that the URL being wrapped by another URL is preventing Universal Links (links opening in the app) from working. However, we're pretty sure this did work at one point. Does anyone know the status of Universal Links with wrapped URLs? Did it change recently? The iOS version that we tested with is 17.5.1. We are opening links from the iOS Gmail app. Thank you!
1
0
37
1d
What is a timeout period for message filter extension's network query
In the documentation of deferQueryRequestToNetwork method which is used to do a network request on message filter extension. There is no mention of timeout period applied to network requests. https://developer.apple.com/documentation/sms_and_call_reporting/ilmessagefilterextensioncontext/2880240-deferqueryrequesttonetwork So my question is what is the timeout period of the deferQueryRequestToNetwork method? And is there some changelog to know has this value changed in some iOS version.
0
0
18
1d
How to setup SharePlay reliably?
Hi, I’m developing an app that uses SharePlay. In specific, I’m using ShareLink in my SwiftUI-based app so that when 2 devices come close, it will start SharePlay via AirDrop, just like how Name Drop works (the animation is super cool, btw). However, I’ve notice that SharePlay doesn’t start reliably under the following conditions: Do both devices need to be signed in using different Apple ID? I wish it works with the same Apple ID. When both devices are running my app, the sharing does not seem to start; maybe both of them are trying to be the host app? When I try to demo this NameDrop-like transaction via Zoom, it usually doesn’t work; maybe because the cable is connected in Lightening port? Is some Mac app (in my case, Zoom or even QuickTime) capturing the screen of the device make it less likely to have successful SharePlay transaction? Thanks!
0
0
37
1d
What is timeout period in message filter extension's network query
In the documentation of deferQueryRequestToNetwork method which is used to do a network request on message filter extension. There is no mention of timeout period applied to network requests. https://developer.apple.com/documentation/sms_and_call_reporting/ilmessagefilterextensioncontext/2880240-deferqueryrequesttonetwork So my question is what is the timeout period of the deferQueryRequestToNetwork method? And is there a changelog that this timeout has changed at some point during iOS update?
0
0
22
1d
The next generation of CarPlay
Hi, We saw the next generation of CarPlay architecture in the WWDC24 video. It's so amazing and exciting! But in the latest CarPlay spec. R9 and Communication Plug-in R18A, we do not find information about the new capabilities such as the next generation CarPlay UIs and compositor. When can we get the documentation and codes for the next-generation CarPlay on the MFi Portal? Thanks.
0
0
46
2d
Watch OS 11 not charging
Just upgraded to Watch OS11 Beta with the watch on charge and put the watch on and it was only 40% charged. I put it back on the charger and it didn’t charge. I erased it and went to repair and it is flat 20 minutes after it was on 40% and sitting on the charger. the message on screen is ‘LOW BATTERY to continue, connect Apple Watch to it’s charger.’ Have I bricked my watch? Thanks
0
0
43
2d