I'm building an application that uses IAP.
I've noticed than when I buy a product in the Sandbox environment (using the following basic code)
SKPayment * payment = [SKPayment paymentWithProduct:product];
[[SKPaymentQueue defaultQueue] addPayment:payment];
If I'm entering the sandbox account credentials for the first time, I see the iTunes sign in dialog with the Use Existing Apple ID, Create New Apple ID, Cancel dialog box.
I then enter my sandbox account credentials...and then I'm prompted with exactly the same dialog box to enter the credentials again...after which I'm able to make a successful purchase.
On subsequent attempts to make a purchase I'm only every prompted for my credentials once.
It only seems to happen if there's no Apple ID setup in Settings->iTunes & App Store -> Apple ID on my device.
Any idea why this is the case?