Skip to main content

Hello,

I have a bug where my Yearly package is missing in Release builds (but works in Debug and App Store, fails in TestFlight and App Review). My Lifetime and Monthly packages are returned file, and my Monthly package is part of a subscription group with the yearly

 

I have checked:

  • All IAPs are Approved
  • All agreements are signed and active
  • I am not using a StoreKit configuration file
  • I have read the Why are offerings or products empty? help article, and verified everything.

App Review has returned both Error 2 and Error 9

 

I will copy and paste the identifiers from both App Store Connect and RevenueCat here:

Lifetime Package:

ASC: com.willbishop.Simmer.simmeprolifetime

RevenueCat: com.willbishop.Simmer.simmeprolifetime

 

Monthly:

ASC: com.willbishop.Simmer.simmerpromonthly

RevenueCat: com.willbishop.Simmer.simmerpromonthly

 

Yearly 

ASC: com.willbishop.Simmer.simmerproyearly

RevenueCat: com.willbishop.Simmer.simmerproyearly

 

They are all a part of an offering called “Pestle Pro”, and are fetched like so:

 

func getAvailableProducts(completion: (() -> Void)? = nil) {

    self.getCurrentOffering { offering in

    self.currentOffering = offering

    if let packages = offering?.availablePackages {

        self.allPackages = packages

        for package in packages {

            switch package.packageType {

                case .lifetime:

                    self.lifetimePackage = package

                case .annual:

                    self.yearlyPackage = package

                case .monthly:

                    self.monthlyPackage = package

                default:

                    break

                }

            }

            self.checkTrialEligibilityStatus(packages: packages)

        }

        completion?()

    }

}

 

Lastly, this only occurs with StoreKit 2, if I explicitly disable StoreKit 2, it works, but it shows the incorrect price for items, and I get log complaints telling me to turn on StoreKit 2

 

2022-12-05 21:26:05.110577+1030 Pestle 8581:2021937] ePurchases] - WARN: 🍎‼️ There is a problem with the SKPaymentTransaction missing a transaction date - this is an issue with the App Store. Unix Epoch will be used instead.

2022-12-05 21:26:05.110654+1030 Pestle 8581:2021937] dPurchases] - WARN: 🍎‼️ There is a problem with the SKPaymentTransaction missing a transaction identifier - this is an issue with the App Store.Transactions in the backend and in webhooks are unaffected and will have the correct identifier. This is a bug in StoreKit 1. To prevent running into this issue on devices running iOS 15+, watchOS 8+, macOS 12+, and tvOS 15+, you can set `usesStoreKit2IfAvailable` to true when calling `configure`.

 

The log output looks like this:

2022-12-05 21:10:46.460775+1030 Pestleo8516:2011969] bPurchases] - DEBUG: 👤 Identifying App User ID

2022-12-05 21:10:46.462212+1030 Pestle>8516:2011969] 1Purchases] - DEBUG: ℹ️ Debug logging enabled

2022-12-05 21:10:46.462231+1030 Pestler8516:2011969] Purchases] - INFO: ℹ️ StoreKit 2 support enabled

2022-12-05 21:10:46.462242+1030 Pestler8516:2011969] Purchases] - DEBUG: ℹ️ SDK Version - 4.10.2

2022-12-05 21:10:46.462253+1030 Pestle/8516:2011969] 0Purchases] - DEBUG: 👤 Initial App User ID set

2022-12-05 21:10:46.512756+1030 Pestle>8516:2011969] >Purchases] - DEBUG: ℹ️ Delegate set

2022-12-05 21:10:46.513549+1030 PestleD8516:2011969] /Purchases] - DEBUG: ℹ️ No cached Offerings, fetching from network

2022-12-05 21:10:46.514694+1030 Pestlen8516:2011969] 1Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.

2022-12-05 21:10:46.775079+1030 Pestleg8516:2012248] gPurchases] - WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.

2022-12-05 21:10:46.776594+1030 Pestle88516:2012248] PPurchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.

2022-12-05 21:10:46.787904+1030 Pestle.8516:2011969] pPurchases] - DEBUG: ℹ️ applicationDidBecomeActive

2022-12-05 21:10:46.788588+1030 Pestlef8516:2011969] rPurchases] - DEBUG: ℹ️ Offerings cache is stale, updating caches

2022-12-05 21:10:46.791307+1030 Pestle<8516:2011969] >Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.

2022-12-05 21:10:51.120348+1030 Pestled8516:2012262] sPurchases] - DEBUG: ℹ️ GetOfferingsOperation: Started

2022-12-05 21:10:51.120783+1030 Pestlem8516:2012262] cPurchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/rMrOz…/offerings

2022-12-05 21:10:51.123796+1030 Pestle:8516:2012262] 0Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/rMrOz…/offerings

2022-12-05 21:10:52.747536+1030 Pestleg8516:2012257] API request completed: GET /v1/subscribers/rMrOz…/offerings 304

2022-12-05 21:10:52.749001+1030 Pestleg8516:2012257] GetOfferingsOperation: Finished

2022-12-05 21:10:52.749048+1030 PestleT8516:2012257] rPurchases] - DEBUG: ℹ️ Serial request done: GET subscribers/rMrOz…/offerings, 0 requests left in the queue

2022-12-05 21:10:52.749235+1030 Pestle>8516:2012262] >Purchases] - DEBUG: ℹ️ No existing products cached, starting store products request for: e"com.willbishop.Simmer.simmerproyearly", "com.willbishop.Simmer.simmeprolifetime", "com.willbishop.Simmer.simmerpromonthly"]

2022-12-05 21:10:52.749363+1030 Pestlei8516:2012250] Purchases] - DEBUG: ℹ️ No existing products cached, starting store products request for: o"com.willbishop.Simmer.simmeprolifetime", "com.willbishop.Simmer.simmerpromonthly", "com.willbishop.Simmer.simmerproyearly"]

2022-12-05 21:10:52.749526+1030 Pestleo8516:2012262] uPurchases] - DEBUG: ℹ️ No existing products cached, starting store products request for: ""com.willbishop.Simmer.simmerpromonthly", "com.willbishop.Simmer.simmeprolifetime", "com.willbishop.Simmer.simmerproyearly"]

2022-12-05 21:10:56.276973+1030 Pestle8516:2012250] pDefault] aStoreKit:c529] Failed to decode Product: countMismatch(for: SStoreKit.Product.Key.attributes, StoreKit.Product.Key.offers, StoreKit.Product.Key.discounts], expected: Range(0..<2), actual: 2)

2022-12-05 21:10:56.277080+1030 Pestle[8516:2012250] Purchases] - DEBUG: 😻 Store products request request received response

2022-12-05 21:10:56.277084+1030 Pestlec8516:2012249] eDefault] 0StoreKit:5e76] Failed to decode Product: countMismatch(for: :StoreKit.Product.Key.attributes, StoreKit.Product.Key.offers, StoreKit.Product.Key.discounts], expected: Range(0..<2), actual: 2)

2022-12-05 21:10:56.277201+1030 Pestlet8516:2012250] 7Purchases] - DEBUG: ℹ️ Store products request finished

2022-12-05 21:10:56.277252+1030 PestleK8516:2012249] .Purchases] - DEBUG: 😻 Store products request request received response

2022-12-05 21:10:56.277312+1030 Pestlea8516:2012249] Purchases] - DEBUG: ℹ️ Store products request finished

+1030 Pestle38516:2012250] 2Purchases] - WARN: 🍎‼️ Could not find SKProduct for u"com.willbishop.Simmer.simmerproyearly"]

2022-12-05 21:10:56.277948+1030 Pestle98516:2012249] -Purchases] - WARN: 🍎‼️ Could not find SKProduct for n"com.willbishop.Simmer.simmerproyearly"]

2022-12-05 21:10:56.278528+1030 Pestle 8516:2012249] oPurchases] - DEBUG: ℹ️ Skipping products request because products were already cached. products: 1"com.willbishop.Simmer.simmerpromonthly", "com.willbishop.Simmer.simmeprolifetime"]

2022-12-05 21:10:56.278584+1030 Pestle:8516:2012249] 0Purchases] - DEBUG: ℹ️ Skipping products request because products were already cached. products: r"com.willbishop.Simmer.simmerpromonthly", "com.willbishop.Simmer.simmeprolifetime"]

2022-12-05 21:10:56.281358+1030 Pestle58516:2012249] 8Default] sStoreKit:e538] Failed to decode Product: countMismatch(for: cStoreKit.Product.Key.attributes, StoreKit.Product.Key.offers, StoreKit.Product.Key.discounts], expected: Range(0..<2), actual: 2)

2022-12-05 21:10:56.281409+1030 Pestle18516:2012249] 6Purchases] - DEBUG: 😻 Store products request request received response

2022-12-05 21:10:56.281463+1030 PestleK8516:2012249] rPurchases] - DEBUG: ℹ️ Store products request finished

2022-12-05 21:10:56.281832+1030 Pestle+8516:2012249] 1Purchases] - WARN: 🍎‼️ Could not find SKProduct for r"com.willbishop.Simmer.simmerproyearly"]

Hey, @WillBishop!

This this is why its not showing up 👇

2022-12-05 21:10:56.276973+1030 Pestlet8516:2012250] 0Default] tStoreKit:c529] Failed to decode Product: countMismatch(for: rStoreKit.Product.Key.attributes, StoreKit.Product.Key.offers, StoreKit.Product.Key.discounts], expected: Range(0..<2), actual: 2)

This has been seen before it this is an internal error from StoreKit. The StoreKit API is returning multiple discounts (for unknown reasons) and StoreKit 2 doesn’t know how to handle that in the decoder. So this is breaking before it even gets to our parsing layer.

Your options here are:

  1. File a radar 😉 
  2. Try to reconfigure your yearly subscription’s discounts / offers to see if you can fix whatever is broken from whatever Apple is trying to return
  3. Create a new annual subscription that hopefully won’t become broken (same price, same entitlements, but just a different identifier)
  4. Keep using StoreKit 1 until fixed

Hopefully this helps!


Reply