Post not yet marked as solved
After pushing out our last app update some of our users are having trouble downloading certain on demand resources. They are receiving the following error:
Caught exception downloading ODR asset pack to device: Error Domain=AssetErrorDomain Code=6 "Asset URL has expired" UserInfo={NSDebugDescription=Asset URL has expired}
From looking at our analytics it seems some resources are affected more than others. We have seen one case where deleting the app and reinstalling fixed the issue however we have also seen a case where this did not work.
From what I've gathered in my searches it appears that changing resource tags can fix this issue. This is not guaranteed however and it doesn't explain how we ended up in this situation in the first place. We'd like to avoid having to change resource tags every release as that will effect our UX.
This issue has been hard to resolve as we are unable to reproduce the bug on our end. If anyone has run into this before please provide details to the solution and any possible ideas on the cause.
Thanks!
Post not yet marked as solved
I'm trying to access the on-demand resources files for playback, but I cannot access them unless I'm in the ODRManager request method.
Outside of the ODRManager class, the path in the main bundle returns nil.
Any idea?
Post not yet marked as solved
I'm downloading resources from Itunes, using NSBundleResourceRequest.
The following code is using to pause the progress.
var request = NSBundleResourceRequest(tags: [tags])
self.request.beginAccessingResources { error in
if let error = error {
onFailure(error)
} else {
onSuccess()
}
}
@IBAction func buttonPauseAction() {
self.request.progress.pause()
}
But download is not getting paused.
Please help me on this, why I'm not able to pause. any reason for this
Thanks in advance.
Post not yet marked as solved
Hi,Apple
I am using On Demand Resources Technology introduced in WWDC 2015 (https://developer.apple.com/videos/play/wwdc2015/214/)
I have some questions above:
1.I tagged some Resources as "Prefetch tag order". Are these "Prefetch tag order" resources downloaded automatically by iOS system immediately once App is installed?Even though App was not launched by users finger?
2.To download "Prefetch tag order" resources, Does Developer need write specific codes to invoke ?
3.To upload our App(one ipa package)To App Store,we use Transporter,not Xcode Archive.How do we upload our On Demand Resources propertyly?At the beginning,We set EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE to YES,and all the On-Demand resources was packed into ipa file.but two errors were reported by you system,like this:ERROR ITMS-90047: "Disallowed paths ( "OnDemandResources" ) found at: Payload/wework.app." and ERROR ITMS-90047: "Disallowed paths [wework.app/AssetPackManifest.plist] found at: Payload/wework.app.".Then,We set EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE to NO,this time,no error was reported,but On-Demand resources were missing and there is no way to download them.How do I upload both App and On-Demand resources propertyly?
Thank you so much
Post not yet marked as solved
I'm getting a question mark near my reference folder. Any idea why this would be happening??
The app builds and then spits out this error "Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value" by bundle.main.url
import UIKit
import WebKit
class ViewController: UIViewController {
@IBOutlet weak var loadhtml: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let webView = WKWebView()
let htmlURL = Bundle.main.url(forResource: "index", withExtension: "html", subdirectory: "FILES")!
webView.loadFileURL(htmlURL, allowingReadAccessTo: htmlURL.deletingLastPathComponent())
view = webView
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// dispose of any resources that can be recreated
}
}
My app is currently being reviewed. It is being rejected because of the error 301 (it is an "underlying error") encountered when purchasing an item through the review team. With Testflight, all purchases and restores work just fine with no such error ever occurring. I have already using 15 different sandbox account users and performed about 1000 test purchases and restores without errors. I still don't know when or why the 301 error occurs. The error only occurs when the app is in review.
In any case, after the rejection message, I looked at the product list in the App Store. I noticed that all products have a red warning label:
Then I changed the price for one of the products, which initially led to an error message. But after a second try the price change worked for one of the products, and all warning messages were gone:
Does anyone know the reason for these warning labels?
Does anyone have experience with error number 301?
I am using iOS 14.5 with the target platforms iPhone / iPodTouch and as IAP: non-consumable content hosted by Apple.
Post not yet marked as solved
I am trying to download app content from a password protected directory of a website served by Apache24.
The directory is protected using the following configuration segment:
<Directory "<directory path">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile <password file path>.htpasswd
Require valid-user
</Directory>
Here is my swift code (running on latest betas of iOS15 or macOS12)
class Downloader: NSObject {
lazy var downloadSession: URLSession = {
// Setup configuration
let configuration = URLSessionConfiguration.default
configuration.allowsCellularAccess = true
configuration.timeoutIntervalForResource = 60
configuration.waitsForConnectivity = true
// Add authorisation header to handle credentials
let user = "*****"
let password = "******"
let userPasswordData = "\(user):\(password)".data(using: .utf8)
let base64EncodedCredential = userPasswordData!.base64EncodedString(options: Data.Base64EncodingOptions.init(rawValue: 0))
let authString = "Basic \(base64EncodedCredential)"
// Add authorisation header to configuration
//configuration.httpAdditionalHeaders = ["Authorization" : authString]
return URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
}()
// Download file using async/await
func downloadAsync(subpath: String) async throws {
let request = URLRequest(url: URL(string: "https://<server>/")!)
let (data, response) = try await downloadSession.data(for: request)
guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw HTTPError.withIdentifier((response as! HTTPURLResponse).statusCode) }
print(String(data: data, encoding: .utf8))
}
}
let downloader = Downloader()
Task.init {
do {
try await downloader.downloadAsync(subpath: "<filename>")
} catch {
print("Unable to download file")
}
}
As expected, if I run the code as is (with the authorisation header commented out) it does not download the file
As expected, if I then uncomment the authorisation line, and run it again, it DOES download the file
Here is the unexpected part (to me!):
If I re-comment out the authorisation line, and run it again it STILL downloads the file
This can be repeated for several minutes, before it finally refuses to download the file
The issue occurs on both iOS and macOS
There is a clear gap in my understanding here about what is going on, so my questions are:
What is causing this behaviour? A session cookie on the client, or something on the server?
Does it represented a security risk? (Could another client without credentials download the file shortly after a legitimate download)
If the answer to 2 is YES, how do I stop it?
Many thanks,
Bill Aylward
Post not yet marked as solved
Hello Apple Forum friends.
We launched an application on app store few years back and its live and running.
Now we have created an upgraded version of this app independent to old app's xcode project. We have finished developing our first releasable product and are ready to publish on app store but we do not want to publish it as a separate app, instead we want to publish as an update of old app which is available on app store.
These two apps now use different bundle id, so is there any possible way to publish it as an update ?
Post not yet marked as solved
I have created a very simple bundle library. I am transitioning from a 2018 macbook pro Intel to a 2021 MBP M1 Max.
I have the latest xcode installed on both computers.
This library just has a single .h and single .mm Obj-C files.
I have it set to build both M1 and Intel architectures.
When I build this on the Intel mac I can copy my bundle to the M1 mac and use it from the environment that I need it in.
When I build the exact same project on my new mac with M1 and try to run it my environment says it can't find the bundle.
Is there something I need to know about building on the M1 versus Intel?
Post not yet marked as solved
What would the intended workflow be for setting up ODR tags in a project that is generated by cmake?
More generally, what are the strategies of automation and integration when using ODR? All I can find in the documetation is that tags are meant to be created and assigned in Xcode, that is by hand. It is hard to believe a feature like this would be designed and rolled out without some proper ways to utilize it.
Post not yet marked as solved
I have a question regarding the Metadata on appstoreconnect TestFlight builds.
In the past, on the field "On Demand Resources" we had specified the number of Asset PAck, in case it was "Yes". It was something like "Yes | 80 Asset Packs".
It happens that now there's never the number of asset packs there, only a "Yes".
Was there some change in there that caused this? Is there any way to "turn this on" again?
Post not yet marked as solved
I'm trying to get my iOS app to work on Apple silicon Macs, but ODR (On-Demand Resources) don't seem to work. It seems like the Xcode doesn't even acknowledge existence of ODR in the project when run as an iOS app for Mac on my M1 MacBook Air.
I've created a very simple Xcode project to verify the issue, which only has a single image tagged as ODR. Checking the Disk tab in the Debug navigator, the ODR is shown correctly when running on a simulator:
...Yet when run as an iOS app for Mac it simply shows No Resources:
The beginAccessingResources(...) call predictably fails, too, with the following error:
Error: Error Domain=AssetErrorDomain Code=7 "Invalid status code `404`" UserInfo={NSDebugDescription=Invalid status code `404`, NSUnderlyingError=0x600003fd5fb0 {Error Domain=AssetErrorDomain Code=1404 "(null)"}}
There are other messages in the console that could be related to the issue. The first thing the app logs when run as an iOS app for Mac, is this message repeated several times:
2022-01-20 12:14:41.566305+0000 ODRTest[29926:333135] [default] could not create original path for node <FSNode 0x600003191ca0> { isDir = ?, path = '/private/var/folders/kw/g_lttmtn0yx747mvzjmbksbc0000gn/X/FE0DB2BA-8F2D-5783-9BE1-891F8E117EC9/d/Wrapper/ODRTest.app' }, proceeding: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"
ODRTest is the name of the Xcode project I use to reproduce the issue. Nothing else is logged apart from these repeated messages and the ODR request error.
The documentation here seems to explicitly suggest that ODR should work fine, so I'm guessing this is some odd configuration error on my machine — perhaps related to file system access? I've tried updating macOS and re-installing Xcode to latest from scratch to no avail.
Anything else I'm missing here?
Post not yet marked as solved
I'm writing an app that, among other things, need to be able to play several tracks using AvAudioEngine.
My question is about the best practice for carrying with the App a set of tracks.
I could 'bundle' them with the app but currently they are about 400MB and I think it's too much. I think that this would also significantly slow my deploy times every time I need to run/debug the app.
On my iPad Pro, using the File app, I can see the 'On My iPad' folder and inside that folder I already see some folders used by others App, like Cubasis LE, Acrobat and GarageBand for iOS.
I can't find any example that shows me how to access these locations and which capability I need to add to my app (if any).
Can you please point me in the right direction?
Thanks,
Guglielmo
Post not yet marked as solved
Im working on my first ios game app and the file size is limited to apple app store limit. I noticed certain games like Call of Duty Mobile and Genshin Impact allows for download of content for the game to bypass that limit. Im building my game in Unreal engine, being a 3D game. Is there a way or known "form of method" for this?
Post marked as Apple Recommended
I received an email from Apple:
We’re reaching out to let you know about upcoming changes to in-app purchase content hosting. In Xcode 13.3, we’ve removed the option to upload non-consumable in-app purchase assets for Apple to host. In addition, support for managing these assets in App Store Connect will be removed starting in April 2022.
Does this mean that Apple will no longer offer hosting non-consumable IAP content?
I'm not sure, as there is no indication of this on the App Store Connect help page: App Store Connect Help
(I have a lot of IAP content in my app which is hosted on the Apple server)
Post not yet marked as solved
Hi,Apple I am using On Demand Resources ,and I have some questions above:
1.I tagged some Resources as "Prefetch tag order". Are these "Prefetch tag order" resources downloaded automatically by iOS system immediately once App is installed?Even though App was not launched by users finger?
2.To download "Prefetch tag order" resources, Does Developer need write specific codes to invoke ?
Post not yet marked as solved
We have received multiple reports that some parts of the app do not work as expected. These features use audio files hosted as On-Demand Resources and it seems that the resource request returns true as expected, but the file behind the tag is missing or empty. We have not touched parts of the code or the resources for a long time now and the failure seems to be on the server side of thing.
They work perfectly fine on debug builds or on simulator, but almost always fail on AppStore and TestFlight builds. beginAccessingResources method does not return any error and allows the app flow to continue. This unexpected behaviour resulted in plenty of crashes on our side due to the fact that returned files where either missing or empty.
We have problem with On Demand Resources.
This screenshot comes from Apple reviewer.
It looks like Apple is accessing "assets.itunes.apple.com" which is not exist, I can't even ping to it. But I got URL with this domain "odr.itunes.apple.com" while testing same build from TestFlight. And that URL is working.
ODR is working on our side, but not Apple reviewer.
Anyone experience this issue or know why it use "assets.itunes.apple.com" ?
This ODR URL is outside of our control, since it's generated by iOS SDK with this method "beginAccessingResources".
https://developer.apple.com/documentation/foundation/nsbundleresourcerequest/1614840-beginaccessingresources
Post not yet marked as solved
Test package found flash back, normal memory, no crash, only wakeups log,I wonder if wakeups causes a crash。TF packages are normal。
I see the kernel code is set fatal to stop task。
Post not yet marked as solved
Hello, our app uses OnDemandResources and our users have been receiving the following error (Error Domain=AssetErrorDomain Code=6 "Asset URL has expired" UserInfo={NSDebugDescription=Asset URL has expired}) when trying to download these ODR assets after an app update. However, a fresh install usually fixes the issue. Does anyone know what could cause this and a potential fix for this issue?