Posts

Post not yet marked as solved
0 Replies
702 Views
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.
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.7k Views
My UIDocumentBrowserViewController-based Mac Catalyst app shows the "open window" when launched; fine. but there is also a blank document window. Once I pick a document, and present my document view controller over my UIDocumentBrowserViewController subclass, the window is filled with the documents contents. How do I get it to hide the blank window behind it?
Posted Last updated
.
Post marked as solved
2 Replies
864 Views
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."?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
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 ?
Posted Last updated
.
Post not yet marked as solved
8 Replies
2.0k Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
780 Views
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.
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.5k Views
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.
Posted Last updated
.
Post marked as solved
1 Replies
515 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
476 Views
macOS 10.15 (19A602), Xcode 11.1 (11A1027)I'm able to use UIDocument.userActivityURLKey when building for iOS.However, when building for MacCatalyst, the compiler throws an error.Docs for UIDocument.userActivityURLKey say it is available in macCatalyst.However, they also list another entry for "macOS", and list NSUserActivityDocumentURLKeyas the declaration of the key.But when I add an #if targetEnvironment(macCatalyst) and use the macOS name, the compiler again throws an error, "Use of unresolved identifier 'NSUserActivityDocumentURLKey'"Is there a way to reference this key in MacCatalyst?
Posted Last updated
.
Post not yet marked as solved
9 Replies
1.9k Views
I'm using a UICollectionViewCompositionalLayout, and an exception is thrown when I load my collection view.The exception says "Cannot solve for a non-group item."Any idea what might be wrong? Or how to fix it?Here's my layout codefunc sideBarSectionCollectionLayout()->UICollectionViewCompositionalLayout { let size = NSCollectionLayoutSize(widthDimension:.fractionalWidth(1), heightDimension:.estimated(105)) let item = NSCollectionLayoutItem(layoutSize: size) let group = NSCollectionLayoutGroup.horizontal(layoutSize: size, subitems: [item]) let section = NSCollectionLayoutSection(group: group) section.contentInsets = NSDirectionalEdgeInsets(top: 5, leading: 5, bottom: 5, trailing: 5) section.interGroupSpacing = 5 return UICollectionViewCompositionalLayout(section: section) }My cells are set up in the storyboard.I'm running xcode 11.1 (11A1027), and catalina 10.15.1 Beta (19B68f)It started after the catalina upgrade from the GM.Here's the relevant part of the stack trace.2019-10-17 04:02:04.556019-0400 SingAccord[4897:254625] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot solve for a non-group item.' *** First throw call stack: ( 0 CoreFoundation 0x00007fff3ab7ff43 __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff70d23835 objc_exception_throw + 48 2 CoreFoundation 0x00007fff3ab9b800 +[NSException raise:format:arguments:] + 88 3 Foundation 0x00007fff3d27a5d1 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191 4 UIKitCore 0x00007fff78be85db -[_UICollectionLayoutItemSolver _solveGroup] + 3778 5 UIKitCore 0x00007fff78be7054 -[_UICollectionLayoutItemSolver _solveForContainer:layoutAxis:traitCollection:maxFrameCount:layoutRTL:preferredSizes:solutionRecursionDepth:] + 253 6 UIKitCore 0x00007fff78be59ac -[_UICollectionLayoutItemSolver solveForContainer:layoutAxis:traitCollection:maxFrameCount:layoutRTL:preferredSizes:] + 110 7 UIKitCore 0x00007fff78bf400b __66-[_UICollectionLayoutSectionEstimatedSolver _solveWithParameters:]_block_invoke.195 + 243 8 UIKitCore 0x00007fff78bf24c6 -[_UICollectionLayoutSectionEstimatedSolver _solveWithParameters:] + 2812 9 UIKitCore 0x00007fff78befc94 -[_UICollectionLayoutSectionEstimatedSolver solveForContainer:traitCollection:layoutAxis:frameCount:preferredSizes:layoutRTL:] + 284 10 UIKitCore 0x00007fff78bcdf77 -[_UICollectionCompositionalLayoutSolver _solveWithSectionLayouts:preferredSizesDict:dataSourceSnapshot:update:] + 1491 11 UIKitCore 0x00007fff78bcd98d -[_UICollectionCompositionalLayoutSolver _solve] + 201 12 UIKitCore 0x00007fff78bc42a1 -[_UICollectionCompositionalLayoutSolver initWithContainer:traitCollection:layoutAxis:dataSourceSnapshot:options:sectionProvider:] + 659 13 UIKitCore 0x00007fff78bbff99 -[UICollectionViewCompositionalLayout _fullResolve] + 1216 14 UIKitCore 0x00007fff78bbec6b -[UICollectionViewCompositionalLayout invalidateLayoutWithContext:] + 1387 15 UIKitCore 0x00007fff788238bb -[UICollectionViewLayout _invalidateLayoutUsingContext:] + 56 16 UIKitCore 0x00007fff788237cf -[UICollectionView _invalidateLayoutIfNecessaryForReload] + 155 17 UIKitCore 0x00007fff7882a031 -[UICollectionView reloadData] + 977 18 UIKit 0x00007fff723af328 -[UICollectionViewAccessibility reloadData] + 42
Posted Last updated
.
Post not yet marked as solved
0 Replies
879 Views
I've implemented a UIDocumentBrowserViewController-based macCatalyst app. I can open files from the file browser, but I'm having trouble opening files from Finder.When I selected "open in" from Finder, the system alternately callsscene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)with 0 elements in the connectionOptions.urlContexts and does not callscene(_ scene: UIScene, openURLContexts URLContextsThe next time I try to open a file from finder, the system does callscene(_ scene: UIScene, openURLContexts URLContextson the scene connected in the previous call (with the newly selected document url) and my app correctly opens the document in the urlcontexts.The next time I try open a file from finder, the sequence repeats, with the system callingscene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)again, also with no files in the connectionOptions.urlContexts, and no call to openURLContexts.The sequence actually starts with the call to openURLContexts, as there is already a connected scene with no presented document.What do I need to do to make the system call willConnectTo with the file url in the connectionOptions.urlcontexts the first time?
Posted Last updated
.
Post not yet marked as solved
2 Replies
768 Views
I like what SiwA could mean for my apps, and now that I'm re-writing my mac app in UIKit so I can deploy on both iPad OS and macOS, I'd like my auto-renewing subscription users to only subscribe once, not on both platforms. But I don't have time to build a lengthy server infrastructure just to support syncing the subscriptions with a database. Which mBaaS companies support SiwA? I already checked backendless, Kinvey, Kumulos, Firebase, and sashido, and didn't see any "drop your SiwA certs here" instructions, and none of these companies has responded to my requests from their pop-up chat bubbles.
Posted Last updated
.