Post

Replies

Boosts

Views

Activity

Unable to make a sandbox purchasing with SubscriptionStoreView
Hi I'm writing my first in-app purchase app, and I'm trying to do some testing with sandbox accounts. I wrote my subscription page use SwiftUI SubscriptionStoreView. And I read the documentation it says : The sandbox account appears in Settings > App Store after the first time you use the device to attempt a purchase in a development-signed app. But I have no idea how to make a sandbox purchasing. Every time I click the subscription button it just making a purchase in xcode environment. Did I missed anything? What can I do to make a sandbox pruchasing?
1
0
58
2d
Unexpected “OTHER” error in CloudKit despite app functioning normally
Hello everyone, I’ve recently encountered an issue where my app is working perfectly fine, but I’m seeing an “OTHER” error in the CloudKit dashboard under errors. I’ve checked the logs and there doesn’t seem to be any obvious failure or issue affecting the app’s functionality. The error doesn’t provide much detail, and I’m having trouble identifying the root cause since everything appears to be functioning as expected in the app. Has anyone else experienced this? Is this something that could be related to a server-side issue, or am I missing something on my end? Any insights or advice would be greatly appreciated! Thanks in advance!
1
1
106
1w
vnop_lookup returning ENOENT aborts rm(1)
When recursively removing a directory with a large number of entries that resides on my custom filesystem, rm(1) aborts with ENOENT. % rm -Rv /Volumes/myfs/linux-kernel/linux-6.10.6 [...] /Volumes/myfs/linux-kernel/linux-6.10.6/include/drm/bridge/aux-bridge.h /Volumes/myfs/linux-kernel/linux-6.10.6/include/drm/bridge/dw_hdmi.h rm: fts_read: No such file or directory I'm observing the following sequence of calls being made. 2024-09-17 17:58:25 vnops.c:281 myfs_vnop_lookup: rm-936 -> dw_hdmi.h ;initial lookup call 2024-09-17 17:58:25 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> 0 ;cache miss 2024-09-17 17:58:25 rpc.c:431 myfsLookup: rm-936 -> dw_hdmi.h ;do remote lookup 2024-09-17 17:58:25 rpc.c:500 myfsLookup: -> myfs_lookup_rpc(dw_hdmi.h) 2024-09-17 17:58:25 rpc.c:502 myfsLookup: <- myfs_lookup_rpc(dw_hdmi.h) -> 0 ;file found and added to vfs cache 2024-09-17 17:58:25 vnops.c:281 myfs_vnop_lookup: rm-936 -> dw_hdmi.h ;subsequent lookup call 2024-09-17 17:58:25 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> -1 ;cache hit 2024-09-17 17:58:25 vnops.c:1478 myfs_vnop_remove: -> myfs_unlink(dw_hdmi.h) ;unlink sequence 2024-09-17 17:58:25 rpc.c:1992 myfs_unlink: -> myfs_unlink_rpc(dw_hdmi.h) 2024-09-17 17:58:25 rpc.c:1994 myfs_unlink: <- myfs_unlink_rpc(dw_hdmi.h) -> 0 ;remote unlink succeeded 2024-09-17 17:58:25 vnops.c:1480 myfs_vnop_remove: <- myfs_unlink(dw_hdmi.h) -> 0 2024-09-17 17:58:25 vnops.c:1487 myfs_vnop_remove: -> cache_purge(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1489 myfs_vnop_remove: <- cache_purge(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1499 myfs_vnop_remove: -> vnode_recycle(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1501 myfs_vnop_remove: <- vnode_recycle(dw_hdmi.h) 2024-09-17 17:58:27 vnops.c:281 myfs_vnop_lookup: fseventsd-101 -> dw_hdmi.h ;another lookup; why? 2024-09-17 17:58:27 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:27 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> 0 2024-09-17 17:58:27 rpc.c:431 myfsLookup: fseventsd-101 -> dw_hdmi.h 2024-09-17 17:58:27 rpc.c:500 myfsLookup: -> myfs_lookup_rpc(dw_hdmi.h) 2024-09-17 17:58:27 rpc.c:502 myfsLookup: <- myfs_lookup_rpc(dw_hdmi.h) -> ENOENT(2) 2024-09-17 17:58:27 vnops.c:371 myfs_vnop_lookup: SET(NNEGNCENTRIES): dw_hdmi.h 2024-09-17 17:58:27 vnops.c:373 myfs_vnop_lookup: ENOENT(2) <- shouldAddToNegativeNameCache(dw_hdmi.h) I checked the value of vnode's v_iocount when vnop_remove and vnop_reclaim are being called. Each vnop_remove and followed by vnop_reclaim with v_iocount set to 1 in both calls, as expected. What I don't understand is why after removing the file is there another lookup call being made, which returns ENOENT to rm(1), which causes it to abort. Any pointers on what could be amiss there would be much appreciated.
3
0
190
1w
Shielding .all(except: ) unexpected behavior
Hi everyone, I’m encountering an issue with shield.applicationCategories = .all(except: applications.applicationTokens) when trying to shield all apps except a specified few. Despite using this configuration, all apps are getting shielded, including those that should be exempt. I’ve verified that the correct applicationTokens are being used and ensured that there are no conflicting schedules that might override this configuration. Interestingly, the ShieldConfiguration appears for the apps that are supposed to be blocked, but not for the ones in the exception list. Has anyone else experienced this issue, or does anyone have insights into what might be causing this behavior? Thanks in advance!
2
1
304
Aug ’24
Sequoia - incorrect alert about "app wants to access data from other app
We have a sync solution with two apps that are an application-group. I use an NSUserDefaults object opened with initWithSuiteName to share config data between the two. That has not been a problem in the past. However,in the Sequoia Beta 7 (24a5327a), when I read or write to the NSUserDefaults from either app, the " would like to access data from other apps" dialog appears. This occurs on every restart on our test systems and more often for some of our customers testing (perhaps with older betas). The warning is not indicative of what I'm doing, and the fact that it comes up every single launch will freak out customers. There was a similar issue opened in Beta 4 that was marked fixed in beta 5: https://developer.apple.com/forums/thread/760072?answerId=799001022#799001022 I posted this in the beta feedback forums before GA but got no response.
5
1
142
1w
error: the replacement path doesn't exist:
I'm using SwiftData with an @Model and am also using an @ModelActor. I've fixed all concurrency issues and have migrated to Swift 6. I am getting a console error that I do not understand how to clear. I get this error in Swift 6 and Swift 5. I do not experience any issue with the app. It seems to be working well. But I want to try to get all issues taken care of. I am using the latest Xcode beta. error: the replacement path doesn't exist: "/var/folders/1q/6jw9d6mn0gx1znh1n19z2v9r0000gp/T/swift-generated-sources/@_swiftmacro_17MyAppName14MyModelC4type18_PersistedPr> opertyfMa.swift"
14
5
944
Aug ’24
Core Data modifications not saved in two of three tables
I'm a bit lost because of a problem I never experienced before: I create entries in 3 Core Data tables and link them. As long as the app is open, everything is fine, I can see the database entries in the three tables. Once the App is closed and restarted, however, the new entries in two of the three tables are gone. I use Core Data for data storage and DB Browser for SQLite for inspecting the database running in the Simulator. Here's the relevant function where all Core Data handling happens: /** Creates a new ComposedFoodItem from the ComposedFoodItemViewModel. Creates the related FoodItem and the Ingredients. Creates all relationships. - Parameter composedFoodItemVM: The source view model. - Returns: A Core Data ComposedFoodItem; nil if there are no Ingredients. */ static func create(from composedFoodItemVM: ComposedFoodItemViewModel, generateTypicalAmounts: Bool) -> ComposedFoodItem? { debugPrint(AppDelegate.persistentContainer.persistentStoreDescriptions) // The location of the .sqlite file let moc = AppDelegate.viewContext // Create new ComposedFoodItem (1) let cdComposedFoodItem = ComposedFoodItem(context: moc) // No existing composed food item, therefore create a new UUID cdComposedFoodItem.id = UUID() // Fill data cdComposedFoodItem.amount = Int64(composedFoodItemVM.amount) cdComposedFoodItem.numberOfPortions = Int16(composedFoodItemVM.numberOfPortions) // Create the related FoodItem (2) let cdFoodItem = FoodItem.create(from: composedFoodItemVM, generateTypicalAmounts: generateTypicalAmounts) // Relate both (3) cdComposedFoodItem.foodItem = cdFoodItem // Add cdComposedFoodItem to composedFoodItemVM composedFoodItemVM.cdComposedFoodItem = cdComposedFoodItem // Add new ingredients (4) if let cdIngredients = Ingredient.create(from: composedFoodItemVM) { cdComposedFoodItem.addToIngredients(NSSet(array: cdIngredients)) // Save new composed food item try? moc.save() // Return the ComposedFoodItem return cdComposedFoodItem } else { // There are no ingredients, therefore we delete it again and return nil moc.delete(cdComposedFoodItem) try? moc.save() return nil } } What the function does: Creates a new entry in table ComposedFoodItem Creates another new entry in another table FoodItem Relates both entries Creates another 1..n entries in a third table Ingredient and links these to the entry created in step 1 All this works fine, I can see all relations and entries in the database. Then I quit and restart the app. The entry created in step 2 is still there, but the entries created in steps 1 and 4 are gone, as well as the relationships (of course). My suspicion: I recently implemented a Core Data migration from Data Model version 1 ("EasyFPU") to version 2 ("EasyFPU 2"). In this migration, I have two custom migration policies for exactly the two tables, which are not stored. The migration policies are pretty simple (and identical for both tables): /** No Ingredient is created in the destination model, i.e., there will be no Ingredients */ override func createDestinationInstances(forSource sourceIngredient: NSManagedObject, in mapping: NSEntityMapping, manager: NSMigrationManager) throws { // Do nothing on purpose debugPrint("Not migrating Ingredient with ID: \((sourceIngredient as? Ingredient)?.id.uuidString ?? "unknown")") } And what I suspect is, that this migration policies are somehow called when restarting the app, but I have no idea why, because the migration has already happened before. If I set a breakpoint in the debugPrint line of the code snippet above, I actually never reach this breakpoint - as expected. Nevertheless are the two tables Ingredient and ComposedFoodItem empty after restart. My AppDelegate Core Data persistentContainer variable looks like this: lazy var persistentContainer: NSPersistentCloudKitContainer = { let container = NSPersistentCloudKitContainer(name: "EasyFPU") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() I tried to replace "EasyFPU" with "EasyFPU 2", but this apparently is not the version, but the container name. Any idea? Thanks in advance!
0
0
58
3d
"Failed to set up CloudKit integration" in TestFlight build
I'm building a macOS + iOS SwiftUI app using Xcode 14.1b3 on a Mac running macOS 13.b11. The app uses Core Data + CloudKit. With development builds, CloudKit integration works on the Mac app and the iOS app. Existing records are fetched from iCloud, and new records are uploaded to iCloud. Everybody's happy. With TestFlight builds, the iOS app has no problems. But CloudKit integration isn't working in the Mac app at all. No existing records are fetched, no new records are uploaded. In the Console, I see this message: error: CoreData+CloudKit: Failed to set up CloudKit integration for store: <NSSQLCore: 0x1324079e0> (URL: <local file url>) Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.cloudd was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.cloudd was invalidated: failed at lookup with error 159 - Sandbox restriction.} I thought it might be that I was missing the com.apple.security.network.client entitlement, but adding that didn't help. Any suggestions what I might be missing? (It's my first sandboxed Mac app, so it might be really obvious to anyone but me.)
3
0
2.4k
Oct ’22
Prevent pausing location updates on background when stationary?
Hello, I'm trying to receive location updates on background mode but it only lasts about 10 minutes then it stops when API detected the "isStationary" is true. Is there any way to continue receiving updates even when the device is stationary? Btw app is not terminated by the user. I'm using CLLocationUpdate.liveUpdates(.otherNavigation) API. CLBackgroundActivitySession is created before calling the liveUpdates. CLLocationManager: let manager: CLLocationManager = { let manager = CLLocationManager() manager.distanceFilter = kCLDistanceFilterNone manager.desiredAccuracy = kCLLocationAccuracyThreeKilometers manager.pausesLocationUpdatesAutomatically = false manager.activityType = .other manager.showsBackgroundLocationIndicator = true manager.allowsBackgroundLocationUpdates = true return manager }() Thank you!
3
0
229
2w
What restrictions does didReceiveRemoteNotification have when the app is started in background by the system?
I previously posted a topic about receiving application(_:didReceiveRemoteNotification:fetchCompletionHandler:) callback when my app is not running, and the system starts the app in the background to respond to a notification. While I receive the callback reliably, the work performed by the callback seems to have different restrictions whether the app is in the background or not running. When the app is running in the background, the work started in this callback completes reliably (in my case it takes no more than a few seconds), and I can post the result back to the system via the completion handler. When the app is not running and the system starts it in the background, the app starts the same work, but this work seems to be terminated quickly without being able to complete, and without me being able to call the completion handler passed to the callback. I’m not talking about 30 seconds - the termination seems to happen after less than a second, which is not enough for my app. The nature of the work shouldn’t matter, but just in case: I start a Task in the callback for some asynchronous work, which stores the completion handler, and calls back to it when the work is finished. This happens completely reliably when the app is running in the background, and not at all reliably when the app is not running and is started by the system. Why would application(_:didReceiveRemoteNotification:fetchCompletionHandler:) behave differently based on if it is ran when the app is already running, vs not running and started by the system? Is there anything I can do on my side to make it more reliable?
1
0
140
4d
Importing Data into SwiftData in the Background Using ModelActor and @Query
I have an app with fairly typical requirements - I need to insert some data (in my case from the network but could be anything) and I want to do it in the background to keep the UI responsive. I'm using SwiftData. I've created a ModelActor that does the importing and using the debugger I can confirm that the data is indeed being inserted. On the UI side, I'm using @Query and a SwiftUI List to display the data but what I am seeing is that @Query is not updating as the data is being inserted. I have to quit and re-launch the app in order for the data to appear, almost like the context running the UI isn't communicating with the context in the ModelActor. I've included a barebones sample project. To reproduce the issue, tap the 'Background Insert' button. You'll see logs that show items being inserted but the UI is not showing any data. I've tested on the just released iOS 18b3 seed (22A5307f). The sample project is here: https://hanchor.s3.amazonaws.com/misc/SwiftDataBackgroundV2.zip
14
8
1.4k
Jul ’24
Checking Equality of ApplicationToken Instances in Swift
Hi everyone, I'm working on a Swift application and trying to determine whether an application has exceeded its limit based on an ApplicationToken. I have the following function to check if the current app's token matches any of the tokens stored when the app limit is reached: private func isAppLimitExceeded(for application: Application?) -> Bool { guard let application = application, let appToken = application.token else { return false } let exceededTokens = configManager.getAppLimitExceededTokens() return exceededTokens.contains { exceededToken in appToken == exceededToken } } The function configManager.getAppLimitExceededTokens() returns a list of [ApplicationToken] that were saved in UserDefaults when an app limit is reached. The goal is to use the isAppLimitExceeded method to verify if the current shield for the app is triggered due to a limit/threshold being exceeded. This function is part of a class that conforms to the ShieldConfigurationDataSource protocol: class ShieldConfigurationExtension: ShieldConfigurationDataSource { // ... } My concern is whether comparing two ApplicationToken instances using == is a reliable method for determining if they are equal. Are ApplicationToken objects guaranteed to be comparable with == out of the box, or do I need to implement Equatable or another method of comparison? Could there be issues with tokens stored in UserDefaults not matching due to reference or serialization differences? Any guidance on how to ensure proper comparison of these tokens would be appreciated! Thanks!
2
0
202
2w
Usb keyboard will wake up system when sending command to it at the time system starting to sleep
Development environment: Electron 30.2.0 Run-time configuration: macOS 14.5 (23F79) DESCRIPTION OF PROBLEM I have one keyboard which will wake up the Mac OS from sleep when sending command to it at the time system starting to sleep. But this keyboard will not have such problem on Window OS, I don't know why sending command to that keyboard will wake up the Mac OS system from sleep. Does anyone know from a hardware or software point of view, what kind of usb keyboard operation will cause the macos system to wake up? Or can someone give us guidance, how to debug and solve the usb keyboard caused by the wake up system problem on Mac OS system? STEPS TO REPRODUCE Sending command to that keyboard when the system start to sleep
1
0
34
5d
Opening external storage in Finder is not working
I am trying to open external/mounted storage in Finder. I simply just want to show the root directory. I have tried multiple things, none worked. NSWorkspace.shared.open() Does work when opening the user's disk (e.g. Macintosh HD), but when comes to any of the external storages a warning appears: "The application "ABC" does not have permission to open "Folder Name". Now, the app ha been granted all permissions in the preferences (Full Disk Access + Files and Folders). Furthermore, I don't even need or care of accessing this directory from within my app. I want the Finder to open it. I am using com.apple.security.files.user-selected.read-only and testing on MacOS: 14.6.1
5
0
240
1w
Regression: Heavy Delay of Push Notifications on iOS 18.1 beta (10s and more)
My app one sec uses push notifications to guide the user back to the app from a Screen Time Shield (screenshot attached). On iOS 18.1, notifications are delivered with a delay of 10+ seconds, even though they are classified as time sensitive: notificationContent.interruptionLevel = .timeSensitive notificationContent.relevanceScore = 1.0 The notification trigger is nil, which according to the documentation should show the notification banner immediately: var notificationTrigger: UNTimeIntervalNotificationTrigger? = nil "The condition that causes the system to deliver the notification. Specify nil to deliver the notification right away." In the sysdiagnose I have noticed that activity related to Apple Intelligence Priority classification delays the notification by 10 seconds ("UserNotificationsCore.IntelligenceActor"): [create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.373 sec]: Timeout of 10.0 reached. Cancelling work. [create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.377 sec]: Calling out to completion with failure(UserNotificationsCore.StepFailure.timedOut(exceeded: 10.0 seconds, summaryStatus: Optional(UserNotificationsServices.NotificationSummaryStatus.inferenceTimedOut), priorityStatus: Optional(UserNotificationsServices.NotificationPriorityStatus.inferenceTimedOut))) from 'scheduleTimeoutToPerform(after:for:)' [create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.378 sec]: Step: UserNotificationsCore.IntelligenceActor, index: 0 exceeded 10.0 seconds This seems like a bug to me, time sensitive notifications should be exempted from being analyzed for priority, especially if that comes at the cost of delaying notifications by 10 seconds. Tracked in Radar: FB15255061
1
0
159
5d
iPhone 16 Pro Max Charging Issues on iOS 18.1 Beta 5 (22B5054e)
I recently got an iPhone 16 Pro Max, and I’m currently running iOS 18.1 Beta 5 (22B5054e). I’ve noticed an issue when charging overnight with MagSafe. My phone stops charging, and last night it stopped at 63%. I’m also having problems when charging via cable. It shows “slow charger” even though I’m using a 100W charger. Is this an issue with iOS 18.1 or could it be a defect with the iPhone itself? I didn’t experience this with my iPhone 15 Pro Max. Thanks
1
0
112
5d
iOS & iPad OS Beta 4, 5 Major Vulnerabilities !
Device name: iPhone 15 Pro Max Purchase date: January this year Usage: The following problems never occurred before upgrading to iOS18.1 beta4 and 5 Current system version: iOS 18.1 beta 5 (22B5054e) Current status: System stuck, unable to operate, abnormal heating, battery capacity reduced by 1% after upgrading to beta5 Detailed description: My phone has been in normal use since purchase, and I have never downloaded or installed cracking tools or files from unknown sources. I concluded that the problem was caused by upgrading the beta version of the ios system. During a period of time when using ios18 beta 4, the phone suddenly became inoperable, the screen failed intermittently, and the failure time became longer and longer. Specifically, the app cannot be operated, and there is no response to sliding up and down, left and right, clicking, touching, and long pressing (almost all APPs, not an exception). In recent days, I found that this phenomenon of the phone seems to be related to charging. Every time it is fully charged, it will not be able to operate when the device is turned on. The iPad and iPhone have the same reaction. During the period when the device is unresponsive, iCloud cannot be synchronized normally, the phone heats up, the software crashes, white dots appear on the edge of the screen (just like a bad pixel on the screen), the video cannot be loaded, and a series of problems. Supplement: Which version can solve these problems? How to return to the official version without flashing? Can I receive version push normally by turning off the beta test switch? Feeling: Since I did not make a full backup of the lower version, I hope that iOS18.1beta5 will solve the problem. Unfortunately, it is still not solved in beta5, and the problem is getting worse. My phone is now a brick and cannot be used normally. This accident is the first time I have encountered such a serious problem since I used Apple devices. I am very disappointed. I hope Apple engineers can fix it as soon as possible.
2
0
202
4d