In-app purchase restore not work in 10.2.1

We have changed our app from being a Purchased (v1.x) to a Free app(Add Version) and included In-App purchase(v2.x) . We installed our app(v1.x) from the App store and then installed (v2.x) from Test filght. In this version, the buy "In-app purchase" and "Restore" options were provided.


When the Restore button was tapped, the app could not restored.The following was also performed in iOS 9.x and 10.1,and it was successfully restored.


In iOS 10.2.1, when I tap the buy "In-app purchase", it promts to Sign in to iTunes store. After succesfully confirming the respective user credentials, it promts me with a "Confirm In-app purchase" alert. On selecting the "Buy" action, it displays "You've already purchased this. Would you like to get it again for free" alert. After tapping on OK, it is then restored successfully.

Replies

The scenarios you are describing are quite confusing.


One thing you wrote:

"We installed our app(v1.x) from the App store and then installed (v2.x) from Test filght. In this version, the buy "In-app purchase" and "Restore" options were provided."


Installing an app over another app rather than deleting the first version will change the code that is run (i.e. you will get the options in v2.x) but it may not change the "signature" of the app - that is, the app installed from Xcode may think it was installed from the App Store and seek out the production environment rather than the sandbox environment for all IAP functions. And the error message you describe may indicate you had tramnsaction for which you did not call finishTransaction

Thanks for Reply.

My code like below, I call finishTransaction method. Already i mentioned, It's successfully restored in iOS 9.x and 10.1.


func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
        for transaction:AnyObject in transactions {
            if let trans = transaction as? SKPaymentTransaction {
                switch trans.transactionState {
                case .purchased:
                    SKPaymentQueue.default().finishTransaction(transaction as! SKPaymentTransaction
                       //Do stuff
                    break
                case .failed:
                     //Do stuff
                    SKPaymentQueue.default().finishTransaction(transaction as! SKPaymentTransaction)
                    break
                case .restored:
                    //Do stuff
                    SKPaymentQueue.default().finishTransaction(transaction as! SKPaymentTransaction)
                    break
                default:
                    break
                }
            }
        }

It's not restored only in iOS 10.2


When i perform restore below method is called


func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) {
    //Do stuff   
   }

1) what is the error returned in restoreCompletedTransactionsFailedWithError


2) Can you comment on this in my earlier post:


One thing you wrote:

"We installed our app(v1.x) from the App store and then installed (v2.x) from Test filght. In this version, the buy "In-app purchase" and "Restore" options were provided."


Installing an app over another app rather than deleting the first version will change the code that is run (i.e. you will get the options in v2.x) but it may not change the "signature" of the app - that is, the app installed from Xcode may think it was installed from the App Store and seek out the production environment rather than the sandbox environment for all IAP functions.

@PBK I got below error when i perform restore


Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}


My mobile have Wi-Fi connection.

I have the same issue - Cannot connect to iTunes Store.

I use React Native for development and TestFlight for testing.

Restore purchases doesn't work in iOS 10.2.1


Guys, did you find a solution?

Same here!


Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store

Is there a site where we can see the In-App Purchase's servers status?