russell-archer / StoreHelper

Implementing In-App Purchases with StoreKit2 in Xcode 13 - 15 using SwiftUI, Swift 5.7 - 5.9, iOS 15 - 17 and macOS 12 - 14. Also supports tvOS and visionOS.
MIT License
422 stars 52 forks source link

Missing products in production ready app #48

Closed chriswitko closed 1 year ago

chriswitko commented 1 year ago

Hi, I have published my app with StoreHelper integration. During tests in dev mode, when I fetch information about the product all seem to work perfectly. Whenever I publish the app via TestFlight (so it's using the production version) the product information is not available. What am I missing here?

To mention, I have added Products.plist and Products.storekit to the bundle resources. Without this product info enabled, I can't properly display the subscription screen, which blocks me from being approved by Apple Review Team.

Should I provide a fallback screen with fixed information about the product (like price, and name) so Apple can review it and accept it? My first thoughts are that my subscription is not reviewed yet (in prod mode) that's why it's not fetched.

Appreciate any help.

russell-archer commented 1 year ago

Hi Chris, that's strange. Personally I've not used TestFlight, I test locally using StoreKit Testing in Xcode (where product info comes from the Products.storekit file), then test in the sandbox environment (where product information is coming from App Store Connect). I then release it for review by the App Store.

The only critical thing is that your Products.plist file is definately included with the release build: StoreHelper1

If I were you I'd set your app for testing in the sandbox environment and then put some kind of temporary check here to make sure your Products.plist file is being read OK: StoreHelper2

The problem is NOT that your app hasn't passed review and that is somehow causing the information to be missing. The product data when testing with the sandbox environment is coming from whatever you've configured in App Store Connect (I assume you have configured your products in App Store Connect?). I would get things working in the sandbox environment. It'll be something small and silly that's causing the problem!

By the way, you shouldn't put some kind of hard-coded fallback information into your app in order to pass the App Store review. Don't forget that the App Store returns localized product info, which you can't do. I suspect that they try different locales during the review process so they'd probably catch your hard-coded list!

So, make sure your product info on App Store Connect is correct and agrees with your Products.plist file. Then check that the Products.plist file IS definately being read using the sandbox environment. My guess is that the problem is with one of those two things.

Let me know how you get on.

chriswitko commented 1 year ago

@russell-archer thank you for your quick response! It gave me thinking, and after reviewing all settings, I found that I need to accept the agreement for paid apps (this is my first app with in-app payments) and add tax information, then all information about products was available as expected

Thank you for your help!

russell-archer commented 1 year ago

Hi Chris, so glad you found the cause of the problem. And thanks for letting me know the issue - I'll add it to my list of common problems :-)

Good luck with launching your app!

Russell