Two sign-in dialogs on in-app purchase

To make an in-app purchase I'm creating an SKPayment with the product id and adding it to [SKPaymentQueue defaultQueue]

If the itunes user is signed in, this works as expected. An alert pops up for the user to input his password and then the transaction prodceeds as usual

If however there is no user currently logged in, I get alert window that asks if I want to "Use Existing Apple ID" or "Create New Apple ID"

I press "Use Existing" and input the user name and password of my test user and press "OK", 1 second pass and then the same popup that asks "Use Existing..." or "Create New..." appears again. I press "Use Existing", again, write the user and password and only after that the transaction continues with the "Confirm Your In-App Purchase" alert.


Why does the sign-in alert appear twice?

Can it be just something wrong with my test user?

You mention a test user. I wonder whether the same issue occurs with a new test user account. The addPayment call should only result in a single presentation of the StoreKit user authentication dialog. The only other StoreKit functions to trigger the presentation of the dialog is

restoreCompletedTransactions and

SKReceiptRefreshRequest.


I wonder if you can make the same issue happen by using the StoreKitSuite iOSInAppPurchase sample code

<https://developer.apple.com/library/ios/samplecode/sc1991/Introduction/Intro.html#//apple_ref/doc/uid/DTS40014726>

You can download the sample, set the application bundle ID to that of your app, and insert the in-app purchase identifiers in the productIDs.plist, and set the codesigning to your certificate, then run the sample.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

It should not appear twice. There may be something wrong with your test user - they do get corrupted. First thing to do is create a new test user and enter that info when asked. Second thing is look at your code and be sure you aren't submitting two purchase requests (e.g. a restore CompletedTransactions and a purchaseRequest or....)

I have seen the same behaviour in our app, and opened a thread here https://forums.developer.apple.com/thread/12054


One answerer said it is a sandbox issue, our update is not on the store yet but it is approved; I hope/think it will work fine in live version.

Hi,


I'm facing the same issue that you and shooshx faced.


Can you confirm is your app is ok in the production environment?

Hi Rich,


I'm having the same problem as shooshx. I've just tried your suggestion to download the StoreKitSuite iOSInAppPurchase sample code and can confirm that the behaviour is the same - two prompts for login credentials.


I've also described my problem below: http://stackoverflow.com/questions/32123903/ios-in-app-purchase-prompted-twice-for-login-using-sandbox-account


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.


It would be great to have some confirmation that this is a sandbox only occurrence and won't happen in a live environment?


Many Thanks

We're having the same issue here. Two log in popups, even for new Sandbox accounts. Please update us once your app goes into production.


Thanks!

Same issue here in Sandbox environment, but works fine in live build.

Just to confirm I am hitting this issue as well in sandbox mode on iOS 9.0.2, building with XCode 7 (Base SDK = iOS9).

Based on your report I will submit to the AppStore (fingers crossed)

Two sign-in dialogs on in-app purchase
 
 
Q