I'm having great trouble with various issues regarding hosted content. Among many attempts to upload an in-app purchase hosted content package, I have only succeeded once, repeatedly receiving the message that my IAP product ID is not recognised. The one time it did succeed, I then realised I wanted to make changes, but could not delete the hosted package or IAP, seemingly because it was being processed. Hence I created a new IAP, but as mentioned previously, it won't recognise my upload. Fundamentally, however, I do not see what the difference would be to upload one bundle with on demand resources versus using hosted content for the IAP and uploading a seperate IAP package. Is it that the IAP hosted content is dowloaded automatically at purchase time? Also, is there any difference between having the IAP content on Apple's servers and downloaded/downloadable when purchased versus having it on the app bundle, which locates ODR on Apple servers anyway? My app makes NSBundleResourceRequests for ODR in the main bundle, but checks to see if the non-consumable unlock of the full game has been purchased and makes further ODR requests. Is it possible that someone can hack my code and request ODR more easily than hosted IAP content?
Post
Replies
Boosts
Views
Activity
I have an app where about 100MB of ODR content is always needed (tagged as prefetch) and a further 300MB of IAP content that is also always needed, once the user has purchased it.
To assure the resources exist, I access the relevant ODR when the app is opened and the IAP ODR when purchased, but I'm concerned that it will be purged while the app is in use.
If this is possible, how do I assure the content is on the device? I could check for the ODR before it's used and if it's not there call a function to download it, but I need to generate a new NSBundleResourceRequest every time and as I understand it, you can only use that request once, so if the function is called more than once, will it be impossible to generate a new NSBundleResourceRequest?
The following question:
https://developer.apple.com/forums/thread/115819
is answered by saying that an app update will cause user data in the library directories to be erased. I tried updating a build in TestFlight and it seems this is not the case. However, a tester updated and had elements of the old build remaining. Having to delete the app and reinstall to solve this problem, his game data was erased, as expected.
I am currently saving the player's game data (a codable object of about 30K) in the caches directory and am concerned that once the app is on the App Store, that any app updates (for bug fixes or whatever) will erase the player's progress. I don't mind that deleting the app will delete all the data, but I want the data to persist across updates.
Could someone please clarify whether or not an app update deletes the caches directory and starts anew and if it does, what's the recommended way to make user data persist across app updates?
I've been using On Demand Resources for a non-consumable IAP and it's all worked pretty well until I realised something unexpected recently.
When testing on Xcode, the IAP is purchased and the content downloaded. Its status is "In Use" and I can access the content. However, the user can then exit the current screen, deallocating the view controller from which the NSResourceBundleRequest was called, at which point, the ODR status changes to "Downloaded".
I thought that when you try to access the content again, it should switch back to "In Use" and be available. However, this does not happen and the app says the content is not in the bundle.
Any ideas?
This is happening to me with TestFlight. It also occurs using Xcode. Nothing to do with device settings. Works perfectly with WiFi. Download is 272MB.
Is this normal?
This app has gone through many small updates without issue and has now been rejected by App Store review, saying it won't load the initial prefetch ODR on startup.
This has never been a problem, except at the very beginning, when it turned out to be an Apple bug issue for TestFlight, but not in review for the App Store. Any possible glitches or changes with iOS 14 that might cause this? Simulator works just fine, but no actual iPad device to test with.
I have a collection view on a view controller. When I dequeue a cell, it is configured with several views, one of which is the view of another view controller.
This sub-view-controller is reinitialised every time the cell is configured. Should I, or should I not, add this sub-view-controller as a child of the parent view controller that owns the collection view?
I have a compositional layout with one section that scrolls orthogonally.
For the groups that are not at the ends of the scroll, I want them to follow groupPagingCentered behaviour, so I set the orthogonal scrolling behaviour accordingly.
However, I want the group at the beginning of the scroll to be left justified (groupPaging behaviour) and the group at the end of the scroll to be right justfied, without changing the separation between groups.
How can I achieve this? (need to support iOS 13)
I have SwiftUI view set as the root view of a UIHostingController. This root view is then added as a subview of the view of a UIViewController. The UIViewController is a property on a parent view controller that deals with a UINavigationController.
The view in the body of the SwiftUI view, ends with:
.navigationBarHidden(someBooleanProperty)
The intention is that when someBooleanProperty switches between true and false, the UIKit navigation bar is shown and hidden accordingly.
This works perfectly on devices running iOS14, but not with iOS15.
Any ideas why?
I've searched the internet for answers, but to no avail.
I can't find a situation where the load(_ request: URLRequest) method of WKWebView would ever return nil, though the return object is WKNavigation?
I've tested on a playground with URLs generated from all kinds of strings and can't make it return nil. I also ran without Internet connection, but I still get a WKNavigation returned.
If it never returns nil, I can be sure that any loading failure can be picked up in the navigation delegate methods, which subsequently simplifies the rest of my code.
Does it ever return nil? If so, under what conditions?
Many thanks in advance