Post

Replies

Boosts

Views

Activity

Does SKTerminateForInvalidReceipt validate receipts?
The documentation for SKTerminateForInvalidReceipt() says"Terminates an app if the license to use the app has expired."And I really didn't want to go to all the trouble to code up all that bit about mnaually verifying receipts, because I don't think pirating my app is that useful, so I just had the prod version of my app call the SKTerminateForInvalidReceipt().However, AppReview says they installed a valid receipt and my app always crashed.So... are the docs right, and SKTerminateForInvalidReceipt correctly detected that AppReview did not install a valid reciept, or is AppReview right, and SKTerminateForInvalidReceipt does not effectively correctly validate recipts, and crash "if the license to use the app has expired."?
2
0
962
Sep ’19
Is UIScreen.screens supported in macCatalyst?
In my iOS apps, I can get a list of the current UIScreens, but it seems in macOS 10.15.0 GM in macCatalyst, this never happens?UIScreen.main has the wrong sizes, for all properties related to the size of the screen.When I plug in an external screen, I don't get the did connect or did disconnect notifications, and UIScreen.screens still has only 1 screen.When I drag my window to the other screen, I get a did change mode notification.UIScreen was such a nice api on iOS, and so much cleaner than the api's on mac, that I thought it would be easy to port my app which uses a full-screen external screen feature, but now it appears there is no external screen support at all, other than the user can drag the windows there?I even tried adding a UIWindowSceneSessionRoleExternalDisplay scene, to see if that would unlock some kind of functionality, and though I'm able to trigger it manually in code, I don't see any other changed behaviors. No automatic initialization of the scene when the external display, no automatic placement of the window in the external screen.Identical results when useing SideCar.Am I seriously stuck using CGGetOnlineDisplayList ?
1
0
1.2k
Oct ’19
Why is .stateRestorationActivity always nil in willConnectTo: ?
I'm trying to implement scene-based state restoration in an iPad OS 13 / macCatalyst app.The docs say .stateRestorationActivity might be nil in scene(_:, willConnectTo:, options:) if data protection is turned on.I don't have data protection turned on in my macCatalyst app, but .stateRestorationActivity is always nil, despite my verifying that stateRestorationActivity(for scene: UIScene) -> NSUserActivity? is returning a non-nil activity with an identifier that's set up in my Info.plist and has the target content identifier:class DocumentViewContoller : UIViewController { ... override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) updateDocumentUrlInTitleBar() let activity = NSUserActivity.newShowActivity() //extension creates this with correct activityType string activity.targetContentIdentifier = document?.fileURL.absoluteString activity.title = document?.fileURL.lastPathComponent view.window?.windowScene?.userActivity = activity guard isViewLoaded ,let activationConditions = view.window?.windowScene?.activationConditions else { return } guard let url = document?.fileURL else { activationConditions.canActivateForTargetContentIdentifierPredicate = NSPredicate(value: true) activationConditions.prefersToActivateForTargetContentIdentifierPredicate = NSPredicate(value: false) return } activationConditions.canActivateForTargetContentIdentifierPredicate = NSPredicate(format: "self == '\(url.absoluteString)'") activationConditions.prefersToActivateForTargetContentIdentifierPredicate = NSPredicate(format: "self == '\(url.absoluteString)'") // activity.becomeCurrent() }and I verified that the predicates were set on the scene in stateRestorationActivity(for scene:)What other conditions do I have to meet in order that my scenes are restored when the app launches again?If it will always be nil, why did the WWDC presenters, in 3 separate talks, tell us we should look for it in that method?If it will always be nil in this method, during which delegate callback method should I expect it to be non-nil?It it will always be nil in all delegate callbacks, then how do I get an app to re-open document scenes which were open when the app was last quit?
8
0
2.2k
Oct ’19
Can I use the app-store receipt to synchronize a non-renewing subscription amongst a devices?
My app does not provide server-side functionality, it's all in the mac app. My purchase model is two fold: 1) consumable purchases for discrete units of work, or 2) time-based subscription for unlimited work units. The consumables work fine, my issues are with non-renewing subscriptions.What I'd like to do is rely on one source of truth, the app receipt. The apple docs say they don't "automatically" synchronize between devices, but can they "manually" synchronize? I.e., if I send a receipt refresh request, does the new receipt contain all the non-renewing subscriptions of my other app on another device where it was purchased? And, is this an acceptible manner of synchronizing receipts between devices, according to AppReview?
1
0
603
Feb ’20
Detect sandbox IAP environment on device?
My macOS app offers non-renewing subscriptions which last for a month. This is long enough that if I change my system clock to test whether the app detects the expiration of the subscription correctly, StoreKit fails to obtain the products available for sale. I would like a way for my app to know it is in the sandbox so it may shorten the subscription durations in the sandbox only, similar to how auto-renewing subscriptions are handled automatically.- These are non-renewing subscriptions, so the sandbox environment doesn't know how long they are supossed to last and can't change their duration automatically for testing as it does for auto-renewing subscriptions. (Despite the fact that AppReview literally called me on the phone and told me it does; there is no place in the appstoreconnect UI to add a duration for a non-renewing subscription.)- I would like the method to work for AppReview as well, so merely doing a custom build which has the subscription duration shortened by build setting, environment variable or command line argument won't suffice.- My users expect this app to work reliably without a reliable internet conneciton. It's already an imposition to ask them to get internet access for making purchases for renewals, but I need the app to know when a subscription has expired without internet access. Thus, I don't think I'm able to post to the store network endpoint that can directly tell me if it's sandbox.
3
0
1.7k
Mar ’20
UIKit internal inconsistency error detected while preparing batch updates map for rebasing.
I'm getting a crash from UICollectionView which may be an Apple bug, but may be my mistake and I'm not sure which.I have 2 UICollectionViews. I'm dragging a cell from one to another. The goal is users can drag-copy items from one to anther. Since UICollectionView won't give me an indexPath when the user drags an item to the end of a section (and therefore I have no idea to which section they are trying to drag an item (which seems like a major oversight to me) ), when the drag session enters the second collection view, I insert temporary items (that are just "+" icons) on the ends of each section in the second collection view. Thus, the user can drag an item to just before the "+" and my code will add it on the end of the items in that section. I track whether these insertions have been done with a bool so I don't accidentally do it twice. The bool affects the response from numberOfItemsInSection, by adding an extra element, and I instigate the change by calling collectionView.insertItems(at: indexPaths). When the drag session ends or exits, and the bool had been set, I set the bool to false and delete the extra items by calling collectionView.deleteItems(at: indexPaths). When the drag session ends in dropSessionDidEnd instead of dropSessionDidExit, I get the exception: "UIKit internal inconsistency error detected while preparing batch updates map for rebasing.". I've noticed that it crashes after a previous drag session does not result in a drop.I've always thought that obj-c exceptions when minor mistakes in table and collection animations were crimes by apple against the app community, but this is seriously holding up my app development. But I'm pulling my hair out trying to figure out what's wrong. I can't seriously move forward with this app crashing this way. I wanted to move my NSTableView-based mac app to a UICollectionView-based MacCatalyst app because of how easy it's supossed to be compared to AppKit, but this has turned out to be a nightmare for weeks.It happens in both MacCatalyst and iOS 13.
0
0
898
May ’20
Is QLSupportsSearchableItems:true required for document-based app quicklook-extension for MacCatalyst?
The WWDC '17 session for core spotlight said QLSupportsSearchableItems is only for "shoebox" apps and explicitly said it's not for document-based apps, but when trying to upload my UIDocumentBrowserViewController-based MacCatalyst app with a quicklook extension (the view-controller-based quicklook preview works great) to App Store connect, it prevents me from uploading without a QLSupportsSearchableItems keys in my quicklook extension's info.plist, and it prevents me from uploading it if the value is false (0). Is the app store validator correct, and I must have this key and it must be true? Do I have to implement func preparePreviewOfSearchableItem(identifier, and if so, can I just have it always fail? If it can't fail, how would I get a sandbox url for the document from a searchable item identifier? Also, Xcode won't find anything when I search for QLSupportsSearchableItems, which is not so much ironic as it is face-palmy.
0
1
799
May ’22