unable to get subscription products macos iap xcode swift

Hi Apple Support,

I am encountering an issue while testing in-app purchases in the sandbox environment.

  1. I have created a sandbox tester account
  2. Logged out of the App Store and System Settings on my Mac.
  3. My main developer account is signed in under Sign In & Capabilities in Xcode.
  4. The Bundle ID matches the one configured in App Store Connect.
  5. The Product ID I am querying also matches the configuration.
  6. Deleting the app and reinstalling.
  7. Restarting my Mac.

When running my code in debug mode, I observe the following:

Running debug build
App Store environment: Production
[1b294b55] Error updating Storefront: Error Domain=StoreKit_Shared.StoreKitInternalError Code=7 "(null)"
Valid products: []
Invalid product IDs: ["com.x.x.x.monthly"]
No products found

The Product ID (com.x.x.x.monthly) matches the one I have configured in App Store Connect.

The bundle id matches.

When I create a StoreKit Configuration file in Xcode and sync it with my app, I can see the product IDs correctly.

Below are the relevant code snippets for fetching and handling products:

func fetchProducts() {
    guard !productIDs.isEmpty else {
        print("No product IDs configured")
        return
    }
    let request = SKProductsRequest(productIdentifiers: productIDs)
    request.delegate = self
    print("Starting product request...")
    request.start()
}

func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
    DispatchQueue.main.async {
        print("Valid products: \(response.products)")
        print("Invalid product IDs: \(response.invalidProductIdentifiers)")
        self.products = response.products
        if self.products.isEmpty {
            print("No products found")
        } else {
            print("products not empty")
            for product in self.products {
                print("Fetched product: \(product.localizedTitle) - \(product.priceLocale.currencySymbol ?? "")\(product.price)")
            }
        }
    }
}

func debugStoreSetup() {
    if let receiptURL = Bundle.main.appStoreReceiptURL {
        if receiptURL.lastPathComponent == "sandboxReceipt" {
            print("App Store environment: Sandbox")
        } else {
            print("App Store environment: Production")
        }
    } else {
        print("No receipt found")
    }
}

Could you help identify why my app is not recognizing the Product ID in the sandbox environment?

Thank you for your assistance.

Any suggestions here?

The latest app store connect shows in-app and subscriptions separately. If i add an in-app i get that. What i dont get are subscriptions. Please advise how to go about this?

unable to get subscription products macos iap xcode swift
 
 
Q