Testing IAP locally on iOS

Hey all I’m trying to use InAppBillingPlugin with Monogame for iOS.

(I have read this similar post and this blog and I’m still a bit puzzled)

Is someone able to please write up a quick few steps on how to get the whole process in a state you can test locally on your iPhone?

This is what I have so far:

  • create a sandbox account in appstore (appstoreconnect → Sandbox → +)
  • on your iPhone log out of your normal account and login using the sandbox acc
  • deploy the app locally using Rider to your iPhone in “Release | iPhone” or “Debug " iPhone” mode and try to make a purchase (this is with a dev certificate and a Wildcard identifier, let’s say the identifier used is com.testing1.game1)
  • Get an error saying “Invalid Product: …”

Is someone able to add the steps I’m missing?

Also I’m puzzled on how to add a product to a game that is not on the appstore? (the game I’m working on is not ready to for a Test Flight)

Got it working. To support this community and for anyone wondering, the process is this:

  • [Optional? at testing stage] Agree to Agreements, Tax, and Banking - includes filling out tax forms / bank details
    Agreements, Tax, and Banking

  • Create a mock / placeholder / throwaway app in the appstoreconnect (this includes creating a identifier/profile)
    https://appstoreconnect.apple.com
    (Save any changes, you won’t need to Submit for Review, you also don’t need to upload your .ipa)
    copy the bundleId

  • Create an IAP in the app (App → Features → In-App Purchases) you created in appstoreconnect
    (click Save, you don’t need to Submit for Review to test this)
    copy the productId

  • Integrate InAppBillingPlugin (examples are provided in their documentation) into your app’s source code

  • Paste the bundleId and the productId into your source code respectively

  • Run VS/Rider to build your app to you device

  • Create a Sandbox Tester Account in the appstoreconnect (appstoreconnect → Sandbox → Testers → + → Fill in details, ensure country is same as app’s country)

  • Run the app and trigger purchase
    (you don’t need to sign out of your Apple ID, a new prompt will pop up asking you to login - use your sandbox account details)

  • To sign out of your sandbox account on your device go to Settings → App Store → SANDBOX ACCOUNT → Click on Apple ID to Sign Out

2 Likes