Posts

Sort by:
Post not yet marked as solved
0 Replies
10 Views
I have found that my Vision Pro device can get into a state where my app is no longer receiving fresh SceneReconstructionProvider updates. It reports that the SceneReconstructionProvider goes into the DataProviderState.running state, and .anchorUpdates will report a set of stale mesh anchors when first fired up, but does not produce any further updates. Once the device gets into this state, I can force quit the app, and even uninstall and re-install it, and I get the same few mesh updates, but no fresh updates until I restart the device. Sample async function below. I can confirm that print("WE FELL OFF THE END OF sceneReconstruction.anchorUpdates") never gets executed, so it stays inside the sceneReconstruction.anchorUpdates loop. let session = ARKitSession() var handTracking = HandTrackingProvider() let sceneReconstruction = SceneReconstructionProvider() let planeDetection = PlaneDetectionProvider(alignments: [.horizontal, .vertical]) let worldTracking = WorldTrackingProvider() ... func start() async { do { await requestAuth() if dataProvidersAreSupported && isReadyToRun && !isRunning { // print("ARKitSession starting.") try await session.run([sceneReconstruction, handTracking, planeDetection, worldTracking]) startCount += 1 // TODO: Fail gracefully if we have to attempt start too many (# TBD) times } else { print("dataProvidersAreSupported: \(dataProvidersAreSupported). isReadyToRun: \(isRunning)") print("handTracking.state: \(handTracking.state), sceneReconstruction.state: \(sceneReconstruction.state) worldTracking.state: \(worldTracking.state), planeDetection.state; \(planeDetection.state)") } }catch { print("ARKitSession error:", error) } } ... func processReconstructionUpdates() async { while (true) { for await update in sceneReconstruction.anchorUpdates { let meshAnchor = update.anchor guard let shape = try? await ShapeResource.generateStaticMesh(from: meshAnchor) else { continue } switch update.event { case .added: let entity = try! await generateModelEntity(geometry: meshAnchor.geometry) entity.transform = Transform(matrix: meshAnchor.originFromAnchorTransform) entity.collision = CollisionComponent(shapes: [shape], isStatic: true) entity.components.set(InputTargetComponent()) entity.name = "mesh" entity.physicsBody = PhysicsBodyComponent(mode: .static) let sortComponent = ModelSortGroupComponent(group: modelSortGroup, order: 1) entity.components.set(sortComponent) entity.components.set(OpacityComponent(opacity: 0.5)) meshEntities[meshAnchor.id] = entity meshesParent.addChild(entity, preservingWorldTransform: true) case .updated: guard let entity = meshEntities[meshAnchor.id], let updatedEntity = try? await generateModelEntity(geometry: meshAnchor.geometry) else { continue } entity.transform = Transform(matrix: meshAnchor.originFromAnchorTransform) entity.collision?.shapes = [shape] if let newMesh = updatedEntity.model?.mesh { entity.model?.mesh = newMesh } case .removed: meshEntities[meshAnchor.id]?.removeFromParent() meshEntities.removeValue(forKey: meshAnchor.id) } print("We now have '\(meshEntities.count)' mesh entities") } print("WE FELL OFF THE END OF sceneReconstruction.anchorUpdates") try? await Task.sleep(nanoseconds: 1_000_000) }
Posted
by
Post not yet marked as solved
0 Replies
7 Views
I've been going through SwiftData documentation, as I'm trying to learn how to work with SwiftData, especially how to use it to cache web responses. "Maintaining a local copy of server data" sample seems to be perfect source for me then, but I find it a little bit confusing, or lacking. There's this function: /// Loads new earthquakes and deletes outdated ones. @MainActor static func refresh(modelContext: ModelContext) async { do { // Fetch the latest set of quakes from the server. logger.debug("Refreshing the data store...") let featureCollection = try await fetchFeatures() logger.debug("Loaded feature collection:\n\(featureCollection)") // Add the content to the data store. for feature in featureCollection.features { let quake = Quake(from: feature) // Ignore anything with a magnitude of zero or less. if quake.magnitude > 0 { logger.debug("Inserting \(quake)") modelContext.insert(quake) } } logger.debug("Refresh complete.") } catch let error { logger.error("\(error.localizedDescription)") } } It says specifically that it "deletes outdated ones", but where does the actual deletion happens? All I can see is call to modelContext.insert(quake) which will update existing entries or create new ones if they don't exist yet, if I'm understanding things right. But quakes that were already in the database, and are not present in the response, don't seem to be deleted anywhere in this function. Or am I missing something?
Posted
by
Post not yet marked as solved
0 Replies
16 Views
created a custom PAM module following this and It works fine with etc/pam.d/sudo but doesn't work with etc/pam.d/authorization and etc/pam.d/login. sudo # sudo: auth account password session auth include sudo_local auth sufficient /usr/local/Cellar/cpam/1.0.0/lib/security/cpam.so auth sufficient pam_smartcard.so auth required pam_opendirectory.so account required pam_permit.so password required pam_deny.so session required pam_permit.so authorization # authorization: auth account auth sufficient /usr/local/Cellar/cpam/1.0.0/lib/security/cpam.so auth optional pam_krb5.so use_first_pass use_kcminit no_auth_ccache auth optional pam_ntlm.so use_first_pass auth sufficient pam_smartcard.so use_first_pass account required pam_opendirectory.so Is it even allowed to add a custom PAM to \etc\pam.d\login or etc\pam.d\authorization ? Is it possible to create a mechanism with custom logic and replace it withbuiltin:authenticate,privileged in system.login.console authorization right ? Note: I have also tried moving the .so file to /usr/lib/pam but it failed even after disabling SIP.
Posted
by
Post not yet marked as solved
0 Replies
19 Views
I'm trying to upload my app with Tap to Pay on iPhone functionality. However, I'm getting error message "Profile doesn't include com.apple.developer.proximity-reader.payment.acceptance entitlement." I've confirmed many times that I have the distribution profile with this capability. Any idea what might be the issue? The development environment works perfectly.
Posted
by
Post not yet marked as solved
0 Replies
12 Views
I have a basic Widget with a button to toggle the home lights, the buttons triggers the following AppIntention: import WidgetKit import AppIntents struct ConfigurationAppIntent: WidgetConfigurationIntent { static var title: LocalizedStringResource = "Bulb state" static var description = IntentDescription("This is an example widget.") } struct ToggleStateIntent: AppIntent { static var title: LocalizedStringResource = "Toggle light state" init(){ } func perform() async throws -> some IntentResult { await WizClient.shared.toggleState() return .result() } } The problem is that I must be running the app with xcode (in my phone, not simulator) to work fine, when I stop xcode the button must be pressed two times to trigger the AppIntention. The toggle function works well on the app with a toggle component. Here is the widget: import WidgetKit import SwiftUI struct Provider: AppIntentTimelineProvider { func placeholder(in context: Context) -> SimpleEntry { SimpleEntry(date: Date(), configuration: ConfigurationAppIntent()) } func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry { SimpleEntry(date: Date(), configuration: configuration) } func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<SimpleEntry> { let timeline = Timeline(entries: [SimpleEntry(date: Date(), configuration: configuration)], policy: .atEnd) return timeline } } struct SimpleEntry: TimelineEntry { let date: Date let configuration: ConfigurationAppIntent } struct BulbActionsEntryView : View { var entry: Provider.Entry var body: some View { HStack { Button(intent: ToggleStateIntent()){ Text("Toggle") } } .padding(.vertical) } } struct BulbActions: Widget { let kind: String = "BulbActions" var body: some WidgetConfiguration { AppIntentConfiguration(kind: kind, intent: ConfigurationAppIntent.self, provider: Provider()) { entry in BulbActionsEntryView(entry: entry) .containerBackground(.fill.tertiary, for: .widget) } } } extension ConfigurationAppIntent { fileprivate static var test: ConfigurationAppIntent { let intent = ConfigurationAppIntent() print("Intent -> \(intent)") return intent } } #Preview(as: .systemSmall) { BulbActions() } timeline: { SimpleEntry(date: .now, configuration: .test) }
Posted
by
Post not yet marked as solved
0 Replies
30 Views
I implemented a store kit in my application, which was working fine until the last three months. Recently, we have encountered an issue where the store kit screen automatically dismisses when attempting to purchase an in-app product using the UPI payment method. This issue specifically occurs with consumable products. Our non-renewable products are working fine with the same code base.
Posted
by
Post not yet marked as solved
0 Replies
25 Views
Is there a way out of the WeatherKit REST API to get a textual summary of the weather like the iPhone app from Apple shows? Right now the local forecast on the iPhone app says "Sunny conditions from 7pm-8pm, with partly cloudy conditions expected at 8PM". Is this something the app rolls on it's own or is there a attribute-value pair in one of the returned JSON datasets that has this text. It's not in the "forecastDaily" dataset. *Humorous that it says "Sunny conditions from 7pm-8pm" because that's about the time the sun is setting. That forecast was from 1PM.
Posted
by
Post not yet marked as solved
1 Replies
41 Views
Hi all , We are planning to manage about 1 Million+ Apple devices of inclusive of both iPhone and Mac devices under a AxM Account. However while adding VPP Licenses for an App i'm prompted with below error: " You cannot order more than 100000 copies of same the free item per week" While our goal is to manage 1 Million devices under same Location token , i have below questions in mind 1 . What is the upper limit of number of Licenses that can be added per app in a Location token? Currently it says 1 Lakh Licenses per app per week . Wanted to know if there is any limit on this count as it shouldn't surprise us in upcoming weeks. 2 . How many Locations can be created in a AxM Account? Currently we created about 15 location to see if there are any limit but so far couldn't find any limit on number of locations that can be created. This limit could help us plan our deployment in advance 3 . What is the total number of licenses a VPP Location token can hold ? As we manage 1 Million Devices for 12 Apps , 1 Million x 12= 12 Million licenses would be transacted in this location token by our MDM Solution , is this okay or will there be any limitations in this count
Posted
by
Post not yet marked as solved
0 Replies
24 Views
I have a view which is a form allowing me to edit details of a category item. In the toolbar, there is a button called "Cancel," whose sole function is to call the rollback function in the ModelContext class. This function should allow you to revert any changes made to the context. However, it appears that this rollback function is neither triggering the view update nor working properly, as I need to restart the app to see the changes reverted which just work when the property "isAutosaveEnabled" is set to false. Container configuration goes below import SwiftUI @main struct Index: App { var body: some Scene { WindowGroup { Window() } .modelContainer( for: [ Bill.self, Category.self ], isAutosaveEnabled: false, isUndoEnabled: true ) } } Rollback usage that don't work import SwiftUI import SwiftData import Foundation struct CategoryForm: View { @Environment(\.presentationMode) private var presentationMode @Environment(\.modelContext) private var modelContext @Bindable var category: Category var body: some View { NavigationStack { Form { Section( header: Text("Basic Information"), content: { TextField("Title", text: $category.name) } ) } .navigationTitle("New Category") .navigationBarTitleDisplayMode(.inline) .toolbar { // Cancel Button ToolbarItem( placement: .topBarLeading, content: { Button( action: onCancel, label: { Text("Cancel") } ) } ) // Done Button ToolbarItem( placement: .topBarTrailing, content: { Button( action: onDone, label: { Text("Done") } ) .disabled(category.name.isEmpty) } ) } } } func onCancel() { modelContext.rollback() presentationMode.wrappedValue.dismiss() } func onDone() { modelContext.insert(category) do { try modelContext.save() } catch { fatalError("Failed to save category") } presentationMode.wrappedValue.dismiss() } }
Posted
by
Post not yet marked as solved
0 Replies
9 Views
I have filed this as FB13722352. I am sharing it here because I haven't seen it mentioned anywhere online yet and am curious if anyone else has run into it. In Xcode 15.3+, writing data to disk fails when running the tests for a Framework project in a fresh simulator. Specifically, if the selected simulator has never been launched before (i.e. is newly-created), any test execution that attempts to write data into the NSDocumentDirectory directory will fail for a period of time after the simulator is first launched (I've observed between 10s and 20s). After that period of time, the same data write action will succeed. It appears that Xcode 15.3+ is starting test execution too soon, without waiting a sufficient amount of time for the Simulator to fully boot. This issue does not occur in Xcode 15.2 or prior versions. Since the issue only appears in a fresh (never-before booted) simulator, it is likely to pop up consistently in CI test runs (where simulators are not re-used). This can cause confusion because the same test would not fail locally when re-using an existing simulator. When the issue appears, the file write API returns the following error: Domain=NSCocoaErrorDomain Code=4 "The folder “testFile” doesn’t exist." UserInfo={NSFilePath=[...]/data/Documents/testFile, NSUserStringVariant=Folder, NSUnderlyingError= {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"} } Reproduction Steps: Open Xcode 15.3 or 15.4. Make sure Simulator.app is closed. Using the "Devices and Simulators" window, create a new iPhone 15 Pro simulator with iOS 17.4 (other devices and OS versions work as well). Do not launch this new simulator. Create a new Framework project and add a test that performs and then checks the output of a data write to the Document directory (see example test code below). Select the new simulator (created in step 2) as the test run target and run the test. Here's an example test that fails in the scenario outlined above: - (void)testBasicRepro { NSString *testString = @"Hello, World!"; NSData *data = [testString dataUsingEncoding:NSUnicodeStringEncoding]; // Get documents directory NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; NSURL *testFileURL = [url URLByAppendingPathComponent:@"testFile"]; // Write the data NSError *error; bool result = [data writeToURL:testFileURL options:NSDataWritingAtomic error:&error]; // Check if it was successful XCTAssertTrue(result); XCTAssertNil(error); XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:testFileURL.path]); } Workaround The workaround that I have come up with is to create a test that runs first (by disabling parallelization and randomization, and making sure the test class filename is alphabetically first). Alternatively, it could be called from the setUp method in any test files that are affected. This test performs a data write and checks the result in a loop in order to block until the data write succeeds (i.e. the Simulator is sufficiently booted for data write operations to complete). - (void)testWorkaroundBug { NSString *testString = @"Hello, World!"; NSData *data = [testString dataUsingEncoding:NSUnicodeStringEncoding]; NSError *error; // Get documents directory NSURL *documentsURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; NSURL *testFileURL; NSDate *startTime = [NSDate date]; NSLog(@"Starting test at %@", startTime); for (int i = 0; i < 120; i++) { // Create unique URL testFileURL = [documentsURL URLByAppendingPathComponent:[NSString stringWithFormat:@"testFile-%@", @(i)]]; // Write the data BOOL success = [data writeToURL:testFileURL options:NSDataWritingAtomic error:&error]; // Check if it exists if (success && [[NSFileManager defaultManager] fileExistsAtPath:testFileURL.path]) { NSLog(@"Test file %@ was created successfully! Elapsed time %@s", @(i), @(fabs([startTime timeIntervalSinceNow]))); return; } else { NSLog(@"Test file %@ was not created. Error: %@. Sleeping for 0.5s and trying again.", @(i), error); [NSThread sleepForTimeInterval:0.5]; } } }
Posted
by
Post not yet marked as solved
0 Replies
29 Views
This code to write UIImage data as heic works in iOS simulator with iOS < 17.5 import AVFoundation import UIKit extension UIImage { public var heic: Data? { heic() } public func heic(compressionQuality: CGFloat = 1) -> Data? { let mutableData = NSMutableData() guard let destination = CGImageDestinationCreateWithData(mutableData, AVFileType.heic as CFString, 1, nil), let cgImage = cgImage else { return nil } let options: NSDictionary = [ kCGImageDestinationLossyCompressionQuality: compressionQuality, kCGImagePropertyOrientation: cgImageOrientation.rawValue, ] CGImageDestinationAddImage(destination, cgImage, options) guard CGImageDestinationFinalize(destination) else { return nil } return mutableData as Data } public var isHeicSupported: Bool { (CGImageDestinationCopyTypeIdentifiers() as! [String]).contains("public.heic") } var cgImageOrientation: CGImagePropertyOrientation { .init(imageOrientation) } } extension CGImagePropertyOrientation { init(_ uiOrientation: UIImage.Orientation) { switch uiOrientation { case .up: self = .up case .upMirrored: self = .upMirrored case .down: self = .down case .downMirrored: self = .downMirrored case .left: self = .left case .leftMirrored: self = .leftMirrored case .right: self = .right case .rightMirrored: self = .rightMirrored @unknown default: fatalError() } } } But with iOS 17.5 simulator it seems to be broken. The call of CGImageDestinationFinalize writes this error into the console: writeImageAtIndex:962: *** CMPhotoCompressionSessionAddImage: err = kCMPhotoError_UnsupportedOperation [-16994] (codec: 'hvc1') On physical devices it still seems to work. Is there any known workaround for the iOS simulator?
Posted
by
Post not yet marked as solved
0 Replies
28 Views
Hello Developer Community, I hope you all are doing well. We need your help to find out about one issue in Mac application deployment outside the App Store. As required notarization, if we want to release the product outside the App Store. We have built the application in ElectronJS and signed it with Developer ID Installer. The next step is notarization, where we get the issue. It says, "Team is not yet configured for notarization." We raised the problem with the Apple team 6 months ago and are still getting the same response from them: "Our engineering team is working on it." without having a timeline. I want to confirm if someone has had the same issue, how long it can take to resolve this, or if you have any solutions. Your support means a lot to us. Thanks. Dhiren Patel
Posted
by
Post not yet marked as solved
1 Replies
40 Views
Is anyone else having the same problems. We been contacting Apple for almost two week, have raised at least 3 or 4 claim tickets to get our issue resolved, but Apple does not/has not responded? Does anyone have recommendation as to what we can do. We are losing money as we cannot open up our App? Thanks, CDL
Post not yet marked as solved
0 Replies
42 Views
Hi there, I'm trying to upload a new build to my app, but I have a windows computer, so seems transporter is out of the equation. Any recommendations to upload the new ipa? A contractor with a mac took care of the original publishing of the app so I'm on my own for this one. Thanks! Evan
Posted
by
Post not yet marked as solved
2 Replies
54 Views
I am trying to find the following icon. I have gone through all the icons in SF Symbols 5.1 but have been unable to locate it. Does anyone know what this icon is or how I can get it?
Posted
by
Post not yet marked as solved
0 Replies
10 Views
I have tried networksetup -setnetworkserviceenabled "USB 10/100/1000 LAN" on networksetup -setnetworkserviceenabled "USB 10/100/1000 LAN" off and same with ifconfig cmd sudo ifconfig down sudo ifconfig up I am able to bounces the interfaces with these commands but the network connectivity is not restored properly for USB 10/100/1000 LAN interface May I know is there any other way we can achieve this programmatically using network framework API available for Mac
Posted
by
Post not yet marked as solved
0 Replies
33 Views
I was wondering if anyone knows why the sample project uses Task.detached everywhere because it seems highly non-standard, e.g. in ContentView: .task { Task.detached { @MainActor in await flightData.load() } } Instead, I would expect to see something like: .task { flightData = await controller.loadFlightData() } Or: .task { await controller.load(flightData: flightData) } Is the use of detached perhaps an attempt to work around some issue with ObservableObject published updates?
Posted
by
Post not yet marked as solved
0 Replies
8 Views
Hello everyone, could someone help me please; I am loading an application in testflight in my Apple Store Connect but when downloading the app on my iPhone device the app has an error and cannot start, I attach the error log that I get from my app. log.crash I am using these versions xcode and MAC versions
Posted
by
Post not yet marked as solved
0 Replies
41 Views
I have an app that utilizes the Network Extension ( Packet Tunnel Provider ), but also uses MDNS to find local devices for data transfer via Network Extensions. However, once connected over Peer to Peer using AWDL0 or NWConnections, it works as expected until a user shuts the screen down. It looks like there's a difference in behavior when the device is plugged in vs when it's on just battery alone. So we can be happily sending data over p2p ( awdl0 ) then a screen shuts off and it kills the connection. Is this expected behavior and if so is there documentation? Also, Network Extensions do not appear to be able to discover over P2P, they can only connect to endpoints directly. Is this expected behavior? My thoughts; If a user allows both the Network Extension Permission and Local Network Permissions that the Network Extension should be able to discover peers via p2p. The connections ( if not asleep ) should stay active while in use.
Posted
by
Post marked as solved
2 Replies
46 Views
I want to automatically load different views depending on OS (OSX or iOS). Is there a way that I can do this without the user having to click on a link? This is my code so far. struct ContentView: View { #if os(iOS) var myOS = "iOS" #elseif os(OSX) var myOS = "OSX" #else var myOS = "Something Else" #endif var body: some View { NavigationStack { VStack { Text("PLEASE WAIT....") .font(.system(size: 24)) .fontWeight(.bold) } .padding() if (myOS == "OSX"){ // Goto Screen for iMac } else{ // go to screen for iOS } } } } If I use "NavigationLink", my understanding is that the user would need to click on a link. Is there some way to do this without user interaction?
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all