IPhone – cannot test in-app purchases

in-app-purchaseiphoneiphone-sdk-3.0

I have created a test account for sandbox testing of in-app purchases. I am following these steps to test

  1. Logged out of any existing accounts
  2. Open app and start getting list of products available
  3. Start process to download a product

    SKPayment *payment = [SKPayment paymentWithProductIdentifier:productId];

    [[SKPaymentQueue defaultQueue] addPayment: payment];

Now ideally I should be asked for the user name/pwd at this point. But I am not prompted for anything and the transaction fails (obviously because I am not logged in)

If I try to login from Settings->Store, it asks for my credit info which I'm sure is not necessary.

Can someone please help me with this issue.

Thanks…

Best Answer

Ok. This was stupid! But hope someone can learn from my mistakes :) I was testing the in-app purchase with a adhoc distribution profile. And acc to Apple engineers, as soon as you do that, the test account "stops" being a test account.

In-app purchases CAN ONLY BE TESTED by launching your app via XCode in debug mode!

Update

This is not true any more. It supposedly works fine with adhoc builds as well now.

Source: recent testing of in-app purchases using an adhoc build.

Related Topic