Search code examples
iosxamarin.formsapp-store-connectin-app

How to test in-app billing in App-Store Sandbox iOS?


I have setup an App in Apple App Store as a free app. Not yet submitted. I added an in-app purchase as auto-renewable subscription

Trying to implement/test this using https://github.com/jamesmontemagno/InAppBillingPlugin within my app.

This returns true-

await billing.ConnectAsync(true);

This then breaks-

var prodInfo = await billing.GetProductInfoAsync(ItemType.Subscription, prodIds);
UNKNOWN ERROR returned.

My only thought is that the prodId for the in-app purchase is not available (yet).

QUESTION: Does the app have to have been submitted for the target in-app purchase to be exposed in the app store for testing with a sandbox appleId account?


Solution

  • Your app's first in-app purchase must be approved by Apple in order to exist at all (i.e. even to be available for testing). Yours, presumably, has not been approved.

    You can submit the app build and the in-app purchase together for approval. However, my experience is that it is actually simpler to submit the app build without the in-app purchase, get it approved, and then submit the in-app purchase for approval.

    Note that your app must visibly provide the correct interface for letting the user interact with the purchase. You should point out to the reviewers where this interface is to be found.