Sandbox environment asks for sign in twice

456 Views Asked by At

I am testing in-app purchases for the new version of our app, the in-app purchase code was tested before and it was working ok however now it asks for itunes sign-in twice before the purchase confirmation alert. It still works fine and purchases the item correctly after the double sign-in but it is a little bit disturbing. Did anybody have a similar issue lately with sandbox servers?

To give some more info actual transaction verification happens on our server, I'm using RMStore for default dummy verification on client side, it actually does nothing but checks if productID exists in app receipt, the cool side is it refreshes app receipt if it is nil or productID does not exist in the receipt. There are only auto-renewing subscriptions in our app, and I logout from appstore before testing a new purchase.

This roughly how my code looks like:

-(void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction * transaction in transactions) {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
            {
                RMStoreAppReceiptVerificator *verificator = [RMStoreAppReceiptVerificator new];

                [verificator verifyTransaction:transaction success:^{

                    NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];

                    NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
                    NSString *receiptStr = [receipt base64EncodedStringWithOptions:kNilOptions];
                    [self sendReceiptToServer:receiptStr];
                }
                failure:^(NSError *error) {
                     ...
                }];
            }
                break;
            case ... : ...
            default: ...
        }
    };
}
1

There are 1 best solutions below

1
On

To get the login to work you have to logout of the settings > itunes. Then login when the app prompts you too using the test account (created on itunes connect).