InAppPurchase StoreKit - no products found

Hi there,

I don’t succeed in implementing InAppPurchase in my iOS app.

I have an iOS app ‘com.mydomain.myapp’ in App Store Connect - not submitted yet.
In Features I have an InAppPurchase defined ‘com.mydomain.myapp.myiap’

Can someone confirm that I don’t have to submit the iOS app first, without IAP feature ?
AFAIK the InAppPurchase must be submitted with the 1st app version, right ?

I’m using Xojo2019r3.1, the latest iOSKit version.

Build settings for iOS have a Team, Build App for iOS=True and In App Purchase=True

I’ve read a lot of forum posts like In-app purchase tutorial and How integrate in-app payment in iOS App and the blog post here In-App Purchases Tutorial on iOS

I’ve downloaded many sample InAppPurchase application, none is actually working.

This is how the helper is initialised:

// iapHelper is a StoreKit.InAppPurchaseHelper property in a module
iapHelper.productIDArray = kProdIDs.Split(",")
iapHelper.ClearInstance = True
iapHelper = iapHelper.GetInstance
iapHelper.Setup
Try
  iapHelper.RequestProductsWithCompletionHandler(AddressOf LoadProduct)
  ...

I’m not getting any errors, it’s just that the LoadProduct always returns 0 products, but success = True.

Public Sub LoadProduct(success as Boolean, products as Foundation.NSArray) Using StoreKit Using Foundation Dim prod As SKProduct For i as Integer = 0 to products.Count-1 prod = new SKProduct(products.Value(i)) ... blahblah Next i End Sub

I know I can’t test the « buy » function in the simulator, but I should get the products.
I’ve been testing on a real device but it’s the same (logs show LoadProduct returns 0 products).

Does anyone have any idea ?

Many thanks !

I had the exact same problem yesterday setting up an app for a customer.

You need to fill out everything in appstoreconnect > Agreements, Tax and Banking

When you bank account number is defined, it can take up to 48hrs for Apple to review it.

[quote=488546:@Jeremie Leroy]You need to fill out everything in appstoreconnect > Agreements, Tax and Banking
When you bank account number is defined, it can take up to 48hrs for Apple to review it.[/quote]
I checked but everything there is filled completely, for years…

Maybe it’s something in my code.

Would you have an example app I could use to check, with your code and my product IDs, if products are found ?

Maybe I found something.

In App Store Connect, Features, the In-App Purchase is « ready to submit » but if I select the menu option App Store Promotions I have an error:

These in-app purchases can’t be promoted on the App Store because your latest approved binary doesn’t include the SKPaymentTransactionObserver method.

Interesting ?!
I’m using StoreKit.InAppPurchaseHelper which is a sub-class of StoreKit.PaymentTransactionObserver.

Am I missing something ?

Finally solved.
It seems the IAP was rejected because the first approved iOS App build didn’t content the IAP yet.

What I did:

  • uploaded a new iOS App build (using macOS App Transporter)
  • created a new IAP feature (same specs) and deleted the previous one

iOS App is now approved and published.

I’ll post into xojo-made-ios-apps-in-the-app-store when the url is ready.