I am trying to implement in-app purchases for an app. I have implemented StoreKit2 and in the Xcode environment, I can make the purchase smoothly without any issues. Once I made a build and put it on a test flight, In the test flight build no products were being fetched there was no error I also added logger and checked.
In-app purchase products are in now the Waiting for review
state.
Below code snippet to fetch products.
func fetchBundles(for productIds: [String]) async throws -> [Product] {
guard productIds.count > 0 else { return [] }
do {
let products = try await Product.products(for: productIds)
print(#file, #function, "products: (products.count)", to: &logger)
return products
} catch {
print(#file, #function, "error: (error.localizedDescription)", to: &logger)
throw error
}
}
Logger:
/Users/amal/Desktop/MyProjects/MamaLinc/MamaLinc/MamaLinc/Modules/Shop/ViewControllers/ShopViewController.swift getShopPageDetail() Constants.IN_APP_PURCHASE_ACTIVE: true, bundles: 4
/Users/amal/Desktop/MyProjects/MamaLinc/MamaLinc/MamaLinc/Modules/Shop/ViewControllers/ShopViewController.swift fetchInAPPProducts(with:) allIds: 11
/Users/amal/Desktop/MyProjects/MamaLinc/MamaLinc/MamaLinc/Helpers/InAPPPurchaseHelper.swift fetchBundles(for:) products: 0
How can i fetch the products, Thanks in advance.