Closed furiosFast closed 3 years ago
Hi @furiosFast, thanks for reporting this issue - please could you let me know what Xcode version you're using, which iOS simulator or device is being used as well as the Swift version please? Thanks in advance!
Hi, yes, of course!
Thanks for the additional information could I also ask - what issues are you seeing as a result of this error message - is the app information failing to load or is it simply that the error message is printed to the console? Line 66 is basically attempting to use StoreKit to automatically retrieve the correct country code for the user in order to retrieve the correct app information for the relevant App Store territory. One workaround would be to set the country code property manually perhaps setting to use Locale.current.regionCode
which the property does fall back to in the event that is unable to retrieve the country code using StoreKit.
The problem is that in my app I do a check at startup to see if an update is available on the app store. This causes me to completely freeze the app for about 45/60 seconds (I think). I also tried to do:
Updates.countryCode = Local.current.regionCode
Updates.appStoreId = myAppId
but in any case the block, until the call times out, happens the same. This is because, if I'm not mistaken, on line 41 the countryCode is never passed as a parameter and therefore is set by default to nil in appStoreURL()
in Updates+Internal.swift
Hi @furiosFast, your setting should take effect because the first line in appStoreURL
is:
static func appStoreURL(appStoreId: String, countryCode: String? = nil, productName: String) -> URL? {
guard let countryCode = countryCode ?? Updates.countryCode else {
return nil
}
However the countryCode
property will still be accessed because it is static therefore the initialisation block will be run before the value you set is applied. Therefore I've added a flag named useStoreKit
- if you set this to false
could you tell me whether this resolves the issue please?
HI, I have implemented and set the new flag, but I can only give you an answer on Friday, as until Friday I have no iPhone 7 to test. I'll hang up. In the meantime, thank you!
No problem - thanks for the update, will wait to hear back. Hopefully this will resolve the issue for you.
Hi, the problem seems to be solved.
Thanks again for the support
That's great to hear thanks glad it's working for you 👍🏻
Hi, when the app call the Updates code and the device is not connected to internet, i've this error in console:
Error Domain=AMSErrorDomain Code=203 \"Bag Load Failed\" UserInfo={NSLocalizedFailureReason=Unable to retrieve p2-product-offers-batch-limit because we failed to load the bag.
The problem is in "Updates.swift" file at the code line 66