Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

SiriTipUIView is missing the application name for an app shortcut
I'm working on an app for an accompanying toy that allows you do drop a marble on a self made track. As a nice bonus I wanted to make it possible to drop a marble using Siri Shortcuts, Siri or the HomePod. So the new iOS 16 App Intents work great for this. The App Intent documentation is bare, but I got the App Intent to work and it evens shows a custom error message when something goes wrong, However I now want to promote the feature. SiriTipUIView is meant for this, however I'm seeing an issue. The application name is missing from the tips UI, instead the phrase starts with a space. The code for the App Shortcuts struct MyAppShortcutsProvider: AppShortcutsProvider {     static var appShortcuts = [         AppShortcut(intent: DropMarbleIntent(), phrases: [             "\(.applicationName) drop marble",             "\(.applicationName) drop a marble",             "Drop a \(.applicationName)",             "Drop \(.applicationName)"         ])     ] } The code for the SiriTipUIView (just for testing) let tipView = SiriTipUIView() tipView.setIntent(intent: DropMarbleIntent()) tipView.sizeToFitUsingConstraints() tipView.allowsDismissal = true presentedSubscription = tipView.publisher(for: \.isPresented).sink { isPresented in if isPresented == false {     self.tableView.tableHeaderView = nil     } } tableView.tableHeaderView = tipView This happens on any iOS 16 simulator and on an iPhone 13 Pro running the iOS 16 release version. Am I missing something, or should I report a bug using feedback?
4
1
1.9k
Sep ’24
Access Bluetooth in system daemon - Unauthorized
Hello, as the title says, I am trying to access Bluetooth in a system daemon. I am running on MacOS Sonoma 14.5. When initializing Bluetooth, my daemon received Unauthorized state. I have tried to add my daemon in the system settings (System Preferences > Security & Privacy > Privacy > Bluetooth) "Allow applications to access Bluetooth" by adding the program executable path defined by the entry Program of my system daemon as suggested here: https://developer.apple.com/forums/thread/662459. But I am still having the issue. Writing a system daemon with Bluetooth is not my final goal. The bigger picture is the smartcard reader driver with Bluetooth access which as the same issue and the solution is probably related. I do not remember how but my smartcard reader driver use to work with Bluetooth but it does now with the same Unauthorized error. As far as I can see daemon and smartcard drivers does not have support for entitlement. Here are the logs for my sample system daemon: my_daemon [0x6000011b0000] activating connection: mach=true listener=false peer=false name=com.apple.server.bluetooth.le.att.xpc bluetoothd [0x7f804828e8a0] activating connection: mach=false listener=false peer=true name=com.apple.server.bluetooth.le.att.xpc.peer[76672].0x7f804828e8a0 bluetoothd Received XPC message "CBMsgIdCheckIn" from session "" bluetoothd Received XPC check-in from session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" fAccessLevel 0 fProgrammaticPairing 0 fLimitedForMediaAccess 0 bluetoothd Access level is less than kXPCAccessLevelSystem for session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67". Restricted state operation not allowed bluetoothd Sending 'session attached' event for session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" bluetoothd Attached session for "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" with session: 0x7f804802d1b0, session handle: 0xef8d0000 bluetoothd Registering peripheral session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" with backgrounding: off, persistence: off (CBSR) restoreID: (null) bluetoothd Error getting Application State for <private>: <private>, 3 bluetoothd Error getting Application State for <private>: <private>, 3 bluetoothd Session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" tccRequired : 1 bluetoothd ReadyForTCC. TCC required:1 fLimitedForMediaAccess:0 fDeviceAccessForMediaExtension:0 bluetoothd Session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" : needsRestrictedStateOperation = 0, overrideRestrictedState = 0 , denylistMode = 0, receivesControllerBTClockEvents=0 my_daemon Received CBMsgIdReadyForTCC my_daemon Running performTccCheck CBManager tccAvail 1, tccRequired 1 my_daemon TCC required my_daemon [0x6000011b8000] activating connection: mach=true listener=false peer=false name=com.apple.tccd my_daemon [0x6000011b8000] failed to do a bootstrap look-up: xpc_error=[3: No such process] my_daemon [0x6000011b8000] invalidated after a failed init my_daemon send_message_with_reply(): user tccd unavailable, sending 0x600000ab4000 to system tccd my_daemon [0x6000011b4000] activating connection: mach=true listener=false peer=false name=com.apple.tccd.system tccd [0x7fd4d1f7ed80] activating connection: mach=false listener=false peer=true name=com.apple.tccd.system.peer[76672].0x7fd4d1f7ed80 tccd REQUEST: tccd_uid=0, sender_pid=76672, sender_uid=0, sender_auid=-1, function=TCCAccessRequest, msgID=76672.1 tccd AUTHREQ_CTX: msgID=76672.1, function=<private>, service=kTCCServiceBluetoothAlways, preflight=no, query=1, client_dict=(null), daemon_dict=<private> tccd AUTHREQ_ATTRIBUTION: msgID=76672.1, attribution={requesting={TCCDProcess: identifier=my_daemon-5555494498236e3b5e2e395b93c13af176769937, pid=76672, auid=0, euid=0, binary_path=/Users/olivier/daemon/my_daemon}, }, tccd AUTHREQ_SUBJECT: msgID=76672.1, subject=/Users/olivier/daemon/my_daemon, tccd Refusing TCCAccessRequest for service kTCCServiceBluetoothAlways from client Sub:{/Users/olivier/daemon/my_daemon}Resp:{TCCDProcess: identifier=my_daemon-5555494498236e3b5e2e395b93c13af176769937, pid=76672, auid=0, euid=0, binary_path=/Users/olivier/daemon/my_daemon} in background session tccd AUTHREQ_RESULT: msgID=76672.1, authValue=0, authReason=5, authVersion=1, error=(null), tccd REPLY: (0) function=TCCAccessRequest, msgID=76672.1 my_daemon [0x6000011b4000] invalidated after the last release of the connection object bluetoothd Received XPC message "CBMsgIdTCCDone" from session "my_daemon-5555494498236e3b5e2e395b93c13af176769937-peripheral-76672-67" tccd [0x7fd4d1f7ed80] invalidated after getting a no-senders notification - client is gone bluetoothd [0x7f80482820f0] activating connection: mach=true listener=false peer=false name=com.apple.tccd.system tccd [0x7fd4d32585f0] activating connection: mach=false listener=false peer=true name=com.apple.tccd.system.peer[169].0x7fd4d32585f0 tccd REQUEST: tccd_uid=0, sender_pid=169, sender_uid=0, sender_auid=-1, function=TCCAccessRequest, msgID=169.48 tccd [0x7fd4d313d880] activating connection: mach=true listener=false peer=false name=com.apple.tccd tccd [0x7fd4d313d880] failed to do a bootstrap look-up: xpc_error=[3: No such process] bluetoothd [0x7f80482820f0] invalidated after the last release of the connection object bluetoothd Bluetooth user permission alwaysAuth: denied tccd [0x7fd4d313d880] invalidated after a failed init tccd FORWARD: to=com.apple.tccd/0, request: { require_purpose=<xpc_null> service="kTCCServiceBluetoothAlways" function="TCCAccessRequest" preflight=true target_token={pid:76672, auid:-1, euid:0} TCCD_MSG_ID="169.48" background_session=false } tccd REPLY: from=com.apple.tccd, reply: { XPCErrorDescription="Connection invalid" } tccd forwardMessage error: Connection invalid. tccd [0x7fd4d3152bf0] activating connection: mach=false listener=false peer=true name=com.apple.tccd.system.peer[169].0x7fd4d3152bf0 bluetoothd [0x7f80482820f0] activating connection: mach=true listener=false peer=false name=com.apple.tccd.system tccd REQUEST: tccd_uid=0, sender_pid=169, sender_uid=0, sender_auid=-1, function=TCCAccessRequest, msgID=169.49 tccd [0x7fd4d32585f0] invalidated after getting a no-senders notification - client is gone tccd [0x7fd4d1f4c810] activating connection: mach=true listener=false peer=false name=com.apple.tccd tccd [0x7fd4d1f4c810] failed to do a bootstrap look-up: xpc_error=[3: No such process] tccd [0x7fd4d1f4c810] invalidated after a failed init tccd FORWARD: to=com.apple.tccd/0, request: { require_purpose=<xpc_null> service="kTCCServiceBluetoothAlways" function="TCCAccessRequest" preflight=true target_token={pid:76672, auid:-1, euid:0} TCCD_MSG_ID="169.49" background_session=false } tccd REPLY: from=com.apple.tccd, reply: { XPCErrorDescription="Connection invalid" } tccd forwardMessage error: Connection invalid.
2
0
1.6k
Sep ’24
Custom struct Codable for SwiftData
I'm encountering an issue encoding/decoding a custom struct from SwiftData. As it's all happening behind the generated code of SwiftData and a decoder, I'm not really sure what's going on. I have a custom type defined kind of like this: public struct Group<Key: Hashable, Element: Hashable> { private var elementGroups: [Element: Key] private var groupedElements: [Key: [Element]] } In short, it allows multiple elements (usually a string), to be grouped, referenced by some key. I have Codable conformance to this object, so I can encode and decode it. For simplicity, the elementGroups is encoded/decoded, and the groupedElements is rebuilt when decoding. My implementation is similar to this: extension Group: Codable where Key: Codable, Element: Codable { private enum Keys: CodingKey { case groups } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: Keys.self) let decoded = try container.decode([Element: Key].self, forKey: .groups) // Enumerate over the element groups, and populate the list of elements. // var elements: [Key: [Element]] = [:] for group in decoded { elements[group.value] = (elements[group.value] ?? []) + [group.key] } elementGroups = decoded groupedElements = elements } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: Keys.self) try container.encode(elementGroups, forKey: .groups) } } This works fine when encoding and decoding to JSON, but when I attempt to use this structure as a value within a SwiftData model, then decoding the type crashes my application. @Model final class MyModel { var id: UUID = UUID() var groups: Group<UUID, String> = Group<UUID, String>() init(id: UUID) { self.id = id } } When something attempts to decode the groups property on the MyModel object, it crashes with the following error: Could not cast value of type 'Swift.Optional<Any>' (0x1ed7d0290) to 'Swift.Dictionary<Swift.String, Foundation.UUID>' (0x121fa9448). I would guess that there is a nil value stored for groups in SwiftData, and attempting to decode it to a Group<UUID, String> type is failing. It's odd that it doesn't throw an exception though, and hard crashes. Also, I'm not sure why it's optional, as a value is being written out. Does anyone have any ideas?
4
1
1.8k
Sep ’24
Error Reading Order File in Apple Wallet
Hello, I’m encountering an issue with Apple Wallet orders. Every time I send an order file to my iPhone, I get the error message: “Error reading order file.” Steps Taken: 1. Order File Structure: • I created an order.json file with the minimal required fields, including: • Order Type Identifier (created on the Apple Developer portal) • Merchant Identifier: (created on the Apple Developer portal) • Status: open • Other necessary fields, such as authenticationToken, createdAt, updatedAt, and payment. 2. Manifest and Signature: • A manifest.json file was generated with the SHA-256 hash for each file (e.g., order.json, images). • The manifest was signed using my Apple developer certificates: • Signer Certificate: signerCert.pem • Signer Key: signerKey.pem • WWDR Certificate: wwdr.pem • Verification of the manifest and signature was done using OpenSSL: • Command used: openssl smime -verify -in signature -inform DER -content manifest.json -noverify • The verification was successful, but the iPhone still returns the error. 3. File Packaging: • The final package includes the following files: • order.json • Images (e.g., gardenya_logo.png) • manifest.json • signature • The files were packaged into a .order file (renamed from .zip). 4. Apple WWDR Certificate: • I used Apple WWDR MP CA 1 - G1 for signing the package. Issue: Despite following all steps in the Apple documentation, the order file cannot be read by the iPhone, and the error message displayed is “Error reading order file.” Additional Information: • Manifest and Signature: Both files have been validated and match the package contents. • Apple Developer Certificates: Used valid Apple Developer certificates. • Order Schema: The order.json file follows Apple’s schema for orders. Could you please provide guidance on resolving this issue? Any suggestions on what could be causing the error, or additional steps to check, would be greatly appreciated. Thank you for your support!
3
0
532
Sep ’24
Ios18 CarPlay/BlueTooth issues
I recently updated my iOS operating system to the latest iOS18. Immediately after updating my CarPlay begin having issues. I began Troubleshooting and came up with some conclusions. If anyone can help that would be amazing. When NOT connected to carplay via cable, the Bluetooth works perfectly. When connected via cable to CarPlay the system is does not recognize Bluetooth. The phone begins to play through speakerphone, radio turns on and is playing in background. please help fix this issue. I can not have carplay not working along with Bluetooth in vehicle.
2
0
1.6k
Sep ’24
SwiftData inverse relationship not updating
Given the code below the students array on the school is not being updated. Why? Since the relationship is explicit and non-optional I would expect this to work. import XCTest import SwiftData @Model class School { var name: String @Relationship(deleteRule: .cascade, inverse: \Student.school) var students: [Student] init(name: String, students: [Student]) { self.name = name self.students = students } } @Model class Student { var name: String var school: School init(name: String, school: School) { self.name = name self.school = school } } final class Test: XCTestCase { func testScenario() throws { let modelContainer = try ModelContainer(for: School.self, Student.self ) let context = ModelContext(modelContainer) context.autosaveEnabled = false let school = School(name: "school", students: []) context.insert(school) let student1 = Student(name: "1", school: school) let student2 = Student(name: "2", school: school) context.insert(student1) context.insert(student2) XCTAssertEqual(school.students.count, 2) // XCTAssertEqual failed: ("0") is not equal to ("2") } }
2
0
904
Sep ’24
Batch delete many-to-one not working
Doing a batch delete on a many-to-one relationship seems to throw this error CoreData: error: Unhandled opt lock error from executeBatchDeleteRequest Constraint trigger violation: Batch delete failed due to mandatory OTO nullify inverse on Student/school and userInfo { NSExceptionOmitCallstacks = 1; NSLocalizedFailureReason = "Constraint trigger violation: Batch delete failed due to mandatory OTO nullify inverse on Student/school"; "_NSCoreDataOptimisticLockingFailureConflictsKey" = ( ); } If I try to delete the School in the one-to-many relationship, both the school and the students are deleted as expected. However, If I try to delete all students the error is thrown. I would expect all students to be removed, while keeping the School intact. Do SwiftData support this? import XCTest import SwiftData @Model class School { var name: String @Relationship(deleteRule: .cascade, inverse: \Student.school) var students: [Student] = [] init(name: String) { self.name = name } } @Model class Student { var name: String var school: School? init(name: String) { self.name = name } } final class Test: XCTestCase { func testScenario() throws { let config = ModelConfiguration(isStoredInMemoryOnly: true) let modelContainer = try ModelContainer(for: School.self, Student.self, configurations: config ) let context = ModelContext(modelContainer) context.autosaveEnabled = false let school = School(name: "school") context.insert(school) let student1 = Student(name: "1") let student2 = Student(name: "2") context.insert(student1) context.insert(student2) student1.school = school student2.school = school XCTAssertEqual(school.students.count, 2) XCTAssertEqual(student1.school?.id, school.id) XCTAssertEqual(student2.school?.id, school.id) try context.save() let newContext = ModelContext(modelContainer) // try newContext.delete(model: School.self) // This works try newContext.delete(model: Student.self) // This one fails } }
1
2
629
Sep ’24
macOS Widgets won't launch with app group set
i'm working on an app which shares a swiftdata database between the main app and its widgets. prior to the sequoia/xcode 16 betas this was working fine with setting the same app group for app & widget targets. however, now whenever i try to run my main app from Xcode i get a user permission requestor saying " would like to access data from other apps.". this happens every time i run it. whenever the widget is started (via trying to place it on the desktop, or the widgetkit simulator etc) it exits immediately (i assume because it can't show the permission requestor?) if i disable the app group for the widget, it runs.. however, of course, i can't access the main app's database. i'm on sequoia beta 2 (24A5279h) and Xcode 16 beta 2 (16A5171r) note: while the widgetkit simulator is now present in sequoia beta 2, i haven't actually been able to successfully use it
6
1
1.1k
Sep ’24
AASA Status Not updating
Ive wrestled with this for days now. My first version of the app that included the app clip worked just fine, and then after using my new domains it says "Cannot Reach AASA File" I have refreshed many times, tried re-making the file and nothing works. When checking my domain, it has the right file and i validated it with branch and json validation. When clicking the app links for the app or the clip, they all work? This is frustrating because i cant create advanced app clips because it says it can't see my file Please Help, something is off here &lt;string&gt;applinks:etherialdimension.pages.dev&lt;/string&gt; &lt;string&gt;appclips:etherialdimension.pages.dev&lt;/string&gt; &lt;string&gt;applinks:etherealdimension.netlify.app&lt;/string&gt; &lt;string&gt;appclips:etherealdimension.netlify.app&lt;/string&gt; &lt;string&gt;applinks:www.etherealdimension.netlify.app&lt;/string&gt; &lt;string&gt;appclips:www.etherealdimension.netlify.app&lt;/string&gt;
1
0
531
Sep ’24
Reverse relationships for models are not always set (iOS 18 RC)
I'm running into an odd case where a model's reverse relationship is sometimes not set despite the forward relationship being there. If the app is closed and reopened however, the reverse relationship for previously added data works. For example, given three models Shelf, Item and ItemDetails: @Model final class Shelf { @Relationship(deleteRule: .cascade, inverse: \Item.primaryShelf) var items: [Item] = [] init() {} } @Model final class Item { var primaryShelf: Shelf? var timestamp: Date @Relationship(deleteRule: .cascade, inverse: \ItemDetail.item) public var detail: ItemDetail? init(primaryShelf: Shelf) { self.primaryShelf = primaryShelf self.timestamp = .now } } @Model final class ItemDetail { var item: Item? init(item: Item) { self.item = item } } Now I want to simply create a shelf, some items and some itemdetails. @Test func testRelationshipsThroughInit() async throws { let schema = Schema([Shelf.self, Item.self, ItemDetail.self]) let config = ModelConfiguration(schema: schema, isStoredInMemoryOnly: true) let container = try ModelContainer(for: schema, configurations: [config]) let modelContext = ModelContext(container) let shelf = Shelf() modelContext.insert(shelf) for _ in 0..<10 { let item = Item(primaryShelf: shelf) modelContext.insert(item) let itemDetail = ItemDetail(item: item) modelContext.insert(itemDetail) } try modelContext.save() let fetchDescriptor = FetchDescriptor<Shelf>() let shelves = try modelContext.fetch(fetchDescriptor) // fails with a random number between 0 and 9 typically #expect(shelves.first?.items.count == 10) } There seem to be two ways that this problem goes away. The first is changing the order of properties set in ItemDetail.init() so that the relationship is set after everything else: @Model final class Item { // ... init(primaryShelf: Shelf) { self.timestamp = .now self.primaryShelf = primaryShelf } With this, everything seems to work fine. The other way seems to be manually setting the reverse relationship. So the loop above gets changed to: for _ in 0..<10 { let item = Item(primaryShelf: shelf) modelContext.insert(item) let itemDetail = ItemDetail(item: item) modelContext.insert(itemDetail) // add reverse relationship even though forward was set shelf.items.append(item) } My question is, is this the expected behavior and If so, is there any place this is documented?
1
0
910
Sep ’24
Clear Purchase History for a Sandbox Apple ID doesn't work
Hello, I'm trying to clear the purchase history made with a sandbox Apple ID on my test device but it does not work. The past purchases are still returned by StoreKit. I've waited many hours but it seems to persist. When I use for await result in Transaction.currentEntitlements { in my app, my non-consumable product is still here. Is it expected? How long should it take to reset the history? Is is supposed to work also for non-consumable products? Thanks Axel
4
10
1k
Sep ’24
AppIntent with flexible return types
To support AppIntent in our app, we plan to follow the same approach as the “Get Details of Reminders” Shortcut Action in the Reminders app, as recommended in this WWDC session (https://developer.apple.com/wwdc24/10176?time=166). The goal is to allow querying all properties of an entity—referred to as “Node” in our app—using a single, configurable intent. For instance, we want one intent that can query properties like “Title,” “Background Color,” and “Font Name” for a specific node. However, since the returned properties have varying data types, this setup requires flexible return types in the perform implementation of our “Get Details” intent. The challenge is that the AppIntent protocol mandates the use ReturnsValue one associated type as the result of perform. For example, we can use ReturnsValue<String> to retrieve the “Title” property, but this would restrict us from using ReturnsValue<Color> for the “Background Color” property. What’s the best approach for implementing an Intent where the return types vary based on the input parameters provided?
1
0
657
Sep ’24
Shortcut action that should return a file deletes the file instead
I have an app intent that returns a file from inside the Sandbox. With iOS 18 RC, the call to INFile results in the file being deleted, instead of the file being returned. intentResponse.file = INFile(fileURL: fileURL, filename: fileName, typeIdentifier: nil) This seems to happen if the file was created by an earlier Shortcut action that calls FileManager().copyItem(), but not for files created by other means. I haven't found a reference in the developer documentation about INFile resulting in the file being deleted. I can block FileManager() from deleting the file by setting its immutable attributes to true, but that prevents me from removing it later.
3
2
712
Sep ’24
VPN Certificate Missing in Trust Settings on iOS 18.0
Hello, I recently upgraded my iPhone 13 to iOS 18.0, and I've encountered an issue with VPN applications. After downloading and installing the required certificate for the VPN, I noticed that it does not appear in the "Certificate Trust Settings." Because of this, I am unable to mark the certificate as "trusted," which results in the VPN application's features not functioning properly. This issue is critical for my VPN usage, and it was not present in previous iOS versions. Could you please provide guidance or suggest a solution to this problem? Thank you for your assistance!
2
2
861
Sep ’24
getaddrinfo AF_INET6 lasts 5 seconds on macOS Sonoma
Hello; we observe slow behavior on some macOS systems which were upgraded from macOS Ventura to macOS Sonoma. , when they are connected to the company networks. Investigation learns that the getaddrinfo call querying ipv6 is taking 5 seconds before returning. Querying information for ipv4 (ai_famlly AF_UNSPEC) returns in few mSec correct. For ipv6, I tried struct addrinfo ai_family AF_INET6 and ai_flags AI_DEFAULT , as well as AI_ALL but no help. Querying for ipv6 lasts 5 seconds. Is there a fix or workaround for this? When switching off Wi-Fi , the getaddrinfo returns in few mSec ( similar to the ipv4 check ). The version is macOS Sonoma 14.6.1 , but also observed on other Sonoma 14.x versions and other sites/companies worldwide.
5
0
396
Sep ’24
iOS 16 Crash _os_unfair_lock_recursive_abort
I found a lot of crashes on iOS 16,the detail infomation: Exception Type:  EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x000000020f3d108c Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [18104] Triggered by Thread:  0 Thread 0 name: Thread 0 Crashed: 0   libsystem_platform.dylib      0x000000020f3d108c _os_unfair_lock_recursive_abort + 36 (lock.c:508) 1   libsystem_platform.dylib      0x000000020f3cb898 _os_unfair_lock_lock_slow + 280 (lock.c:567) 2   libobjc.A.dylib               0x00000001ba6939b4 lookUpImpOrForward + 156 (lock_private.h:716) 3   libobjc.A.dylib               0x00000001ba68e0c4 _objc_msgSend_uncached + 68 (:-1) 4   myApp                        0x00000001005e8d04 post_crash_callback + 64 (XBPLCrashManager.m:122) 5   myApp                        0x0000000101453744 signal_handler_callback + 184 (PLCrashReporter.m:237) 6   myApp                        0x000000010144fc6c internal_callback_iterator(int, __siginfo*, __darwin_ucontext*, void*) + 140 (PLCrashSignalHandler.mm:0) 7   myApp                        0x000000010144fbc0 plcrash_signal_handler + 24 (PLCrashSignalHandler.mm:201) 8   libsystem_platform.dylib      0x000000020f3cca90 _sigtramp + 56 (sigtramp.c:116) 9   libsystem_kernel.dylib        0x00000001fed74bf0 abort_with_payload_wrapper_internal + 104 (terminate_with_reason.c:102) 10  libsystem_kernel.dylib        0x00000001fed74b88 abort_with_reason + 32 (terminate_with_reason.c:116) 11  libobjc.A.dylib               0x00000001ba6bfa5c _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 116 (objc-errors.mm:199) 12  libobjc.A.dylib               0x00000001ba6bf9e8 _objc_fatal(char const*, ...) + 32 (objc-errors.mm:215) 13  libobjc.A.dylib               0x00000001ba6bf978 cache_t::bad_cache(objc_object*, objc_selector*) + 228 (objc-cache.mm:829) 14  libobjc.A.dylib               0x00000001ba6944f0 cache_t::insert(objc_selector*, void (*)(), objc_object*) + 296 (objc-cache.mm:901) 15  libobjc.A.dylib               0x00000001ba693ba8 lookUpImpOrForward + 656 (objc-runtime-new.mm:6739) 16  libobjc.A.dylib               0x00000001ba68e0c4 _objc_msgSend_uncached + 68 (:-1) 17  UIKitCore                     0x00000001c36f9ad8 -[UIViewController initWithNibName:bundle:] + 216 (UIViewController.m:2671) 18  myApp                        0x0000000100d78088 -[myUIBaseViewController init] + 44 (myUIBaseViewController.m:60) 19  myApp                        0x000000010031f744 -[XBSCLaunchManager makeTabBarViewController] + 2600 (XBSCLaunchManager.m:432) 20  myApp                        0x000000010032022c -[XBSCLaunchManager showTabbarViewController] + 292 (XBSCLaunchManager.m:569) 21  libdispatch.dylib             0x00000001c89ecfdc _dispatch_client_callout + 20 (object.m:560) 22  libdispatch.dylib             0x00000001c89f046c _dispatch_continuation_pop + 504 (inline_internal.h:2632) 23  libdispatch.dylib             0x00000001c8a03a58 _dispatch_source_invoke + 1588 (source.c:596) 24  libdispatch.dylib             0x00000001c89fb748 _dispatch_main_queue_drain + 756 (inline_internal.h:0) 25  libdispatch.dylib             0x00000001c89fb444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887) 26  CoreFoundation                0x00000001c146a6d8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780) 27  CoreFoundation                0x00000001c144c03c __CFRunLoopRun + 2036 (CFRunLoop.c:3147) 28  CoreFoundation                0x00000001c1450ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 29  GraphicsServices              0x00000001fb4a7368 GSEventRunModal + 164 (GSEvent.c:2196) 30  UIKitCore                     0x00000001c394686c -[UIApplication _run] + 888 (UIApplication.m:3754) 31  UIKitCore                     0x00000001c39464d0 UIApplicationMain + 340 (UIApplication.m:5344) 32  myApp                        0x0000000100330b5c main + 88 (main.m:14) 33  dyld                          0x00000001dfc72960 start + 2528 (dyldMain.cpp:1170)  Request for help on advice prevention and fix for this. Thanks
3
1
3.1k
Sep ’24
促销优惠 报错ineligibleForOffer
你好: 以下是我的问题: 问题类型:苹果内功IAP相关问题 问题详情:我想问一下苹果的按月订阅商品设置了“促销优惠”(即在调用支付API时设置了paymentDiscount字段),具体优惠内容为首月免费,这种“促销优惠”优惠形式对首次订阅的账号无效吗?因为首次订阅的账号尝试订阅时会返回ineligibleForOffer错误,导致无法正常订阅,希望得到回复。谢谢
1
0
433
Sep ’24
[iOS18] Crash in `static NSDecimal./ infix(_:_:)`
Crashed: com.apple.main-thread 0 Foundation 0x2bd25c specialized static NSDecimal._integerDivide(dividend:divisor:maxResultLength:) + 1996 1 Foundation 0x2c1c0c specialized NSDecimal._divide(by:roundingMode:) + 2432 2 Foundation 0x372710 static NSDecimal./ infix(_:_:) + 64 Crashed: com.um.positions.fiber.queue 0 Foundation 0x2bdc94 <redacted> + 1996 1 Foundation 0x2c2644 <redacted> + 2432 2 Foundation 0x372804 $sSo9NSDecimala10FoundationE1doiyA2B_ABtFZ + 64 After iOS18, some new crashes appeared, but they never appeared before iOS18. How to avoid such crashes? I checked the API documentation and there is no relevant modification, https://developer.apple.com/documentation/foundation/1409398-nsdecimaldivide However, I parsed iOS_22A5326g/../Foundation.framework/Foundation, and found that this EXC_BREAKPOINT is newly added You can reproduce it with the following code: let a: Decimal = .greatestFiniteMagnitude let b: Decimal = .greatestFiniteMagnitude let c = a / b // if < iOS18, c = 1. if = iOS18, will crashed ;< print(c)
3
1
919
Sep ’24
Intermittently Transaction.latest(for:) api returns nil and unverified transaction
We are using method “Transaction.latest(for: productId)” to verify the transaction . Steps to reproduce : Step 1 : User made purchase for productId “product_id_one” Step 2 : “paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])” api returns successful purchase for product_id_one . func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { for transaction in transactions { switch transaction.transactionState { case .purchased: let mProductId = transaction.payment.productIdentifier Print(mProductId) // product_id_one .. Step 3: Call “Transaction.latest(for: product_id_one)” api . guard let verificationResult = await Transaction.latest(for: productId) else { // Here some times its returning nil for valid transaction return } switch verificationResult { case .verified(let transaction): // at time its working fine . we are getting verified purchase . // Check the transaction and give the customer access to purchased case .unverified(let transaction, let verificationError): // Here some times its returning unverified for valid transaction } Issue : For valid purchase , Sometimes Transaction.latest(for: productId) api is returning nil and unverified transaction . This is intermittent  issue.
0
0
321
Sep ’24
SwiftUI @main Accessing UserDefaults Too Early Before applicationDidFinishLaunching
I'm working on a macOS and iOS app using SwiftUI. And received bug from very few user that they are being logged out, even tho they didn't. So i'm assuming issue is relevant to this forum post, and that the keychain data and user defaults aren't available very early on in an app's lifecycle (presumably from cold start). There is fix available for iOS but didn't find anything relevant to isProtectedDataAvailable for macOS. I'm accessing UserDefaults in my @main view's sub view. It seems that UserDefaults is accessed too early, before applicationDidFinishLaunching. And therefore, not getting user data on launch sometimes. This issue is very rare, i'm not able to reproduce this, but assuming this can be cause based on some form post, also because view's onAppear calls before applicationDidFinishLaunching.
3
0
483
Sep ’24