Post

Replies

Boosts

Views

Activity

Sandbox users always are owning application
Hi! I'm trying to implement a two week free trial for my existing paid ipad app. Following the guidance from the wwdc2022/10007, I'm using AppTransaction.shared and checking the result. I'm getting a verified result, but the appTransaction.originalPurchaseDate is always the same date - 2013-08-01 07:00:00 +0000 / 397033200, even the particular sandbox account user never had a purchase. This makes testing the logical branch of "has this user never purchased this app before" if the app store is always telling us that it's been purchased. (I've been using new sandbox account, so there should be no history) Here's some code that includes hacking around always getting that original purchase date. We're in the final stretches, and wanting to test things that will be closer to actual store behavior (and I'm thinking that always returning a purchased date for an unpurchased app wouldn't be happening) Am I just holding things wrong? Sandbox bug/limitatiin I just have to live with? thanks! ++md class MJAppStore: NSObject { @objc static let shared = MJAppStore() @objc func verifyAppStoreStatus(_ completion: @escaping (MJAppStoreStatus, Error?) -> Void) { Task { do { let status = try await doVerificationThing() completion(status, nil) } catch { completion(.error, error) } } } func doVerificationThing() async throws -> MJAppStoreStatus { do { let result = try await AppTransaction.shared print("TRIAL: survived AppTransaction.shared") switch result { case .unverified(_, _): print("TRIAL: app transaction UNVERIFIED") return .free case .verified(_): let appTransaction = try result.payloadValue // hack around the app store sandbox accounts saying we're purchased even though // we're not really. 2013-08-01 07:00:00 +0000 print("TRIAL: app transaction VERIFIED \(appTransaction.originalPurchaseDate.timeIntervalSinceReferenceDate) -> \(appTransaction.originalPurchaseDate)") if appTransaction.originalPurchaseDate.timeIntervalSinceReferenceDate == 397033200 { return .free } else { return .purchased } } } catch { ...
4
0
560
Jun ’24
Requesting modelEntity from Photogrammetry complains about missing metallib in bundle
Hi! I've adapted the Mac Photogrammetry sample to iOS - works great. When I request a modelEntity, the completion callback doesn't get called (the other completions, like model file, poses and pointcloud, work fine), and "Could not locate file 'default-binaryarchive.metallib' in bundle." is printed to the console. Are they related? Should I be getting a modelEntity result? It's using the "Rock" images from the mac sample code.
0
1
266
Aug ’24
Unable to export a captured RoomPlan
Hi! I'm currently doing a simple RoomCaptureView-based room capture (iOS 17, iPhone 15 super mega ultra pro max), and I'm unable to export anything I capture, even though I have a dollhouse I can play with after the export. Attached is a screen grab of the doll-house expand/collapse view. (it always fails) My export code is in the RoomCaptureView delegate. The passed in error is nil. func captureView(didPresent processedResult: CapturedRoom, error: (Error)?) { let fm = FileManager() do { let documentDirectoryURL = try fm.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let now = generateCurrentTimeStamp() // of the form 2023_10_02_09_45_58 let destinationURL = documentDirectoryURL.appendingPathComponent("\(now).usdz") try processedResult.export(to: destinationURL) } catch { print("oops no processed result? \(error)") } } The constructed URL is: file:///var/mobile/Containers/Data/Application/7DD98157-909A-40A1-9271-1AFCD5336E8B/Documents/2023_10_02_09_45_58.usdz The error in the catch is (not sure where the rest of my path went...): ▿ Error ▿ cannotCreateNode : 1 element - path : "/2023_10_02_09_45_58" And this is printed to the console: Warning: in SdfPath at line 151 of sdf/path.cpp -- Ill-formed SdfPath </2023_10_02_09_38_17>: syntax error Coding Error: in _IsValidPathForCreatingPrim at line 3338 of usd/stage.cpp -- Path must be an absolute path: <> The same sequence happens if I use any of the different export types (mesh-default, parametric, model). I'd attach my project but looks like zip files and dropbox links are forbidden here. If you want a small sample project, feel free to email me at markd at borkware dot com (since looks like emails are forbidden here too) Thanks in advance! I'd love to present this to my cocoaheads in a couple of weeks.
4
0
740
Oct ’23