ios – Calling end on an unfinishedTransaction would not work


So, we have carried out IAP with StoreKit2 e2e for each the consumer and backend and it is working largely completely, nonetheless we have now a difficulty which we can not seem to perceive Apple’s conduct.

So, think about a purchase order that occurred on the tenth of December within the sandbox setting by an set up from TestFlight, and this similar buy retains getting queued within the Transaction.unfinished record for some cause (as we speak, the seventeenth of December, a complete week after the preliminary buy!). It might be occurring because of the sandbox setting, however we won’t know for positive.

This is the move:

We iterate the record on app launch
Ship the unfinishedTransaction’s transactionId to our servers
The server says “hey, we may confirm it with Apple but it surely’s not longer lively (expired). We won’t actually work with it so simply end it in your facet and do not ship it to me once more”
The consumer finishes!! the transaction
On the very subsequent app launch it retains reappearing within the Transaction.unfinished queue
Are we doing one thing flawed? why would not it get cleaned? Is that this an anticipated conduct?

Observe, that is typically the server’s logic for brand new purchases:

  1. If we weren’t in a position to contact Apple – we inform the consumer to not end the transaction in order that we’ll be capable to re-iterate it on the subsequent app launch or retry
  2. If the transaction shouldn’t be expired and legitimate – we replace our information and inform the consumer to complete the transaction
  3. If we could not replace our information – we inform the consumer to not end the transaction in order that we’ll be capable to re-iterate it on the subsequent app launch or retry
  4. If the transaction shouldn’t be legitimate for some cause – we inform the consumer to complete the transaction

Appears about proper or ought to we at all times goal to complete the transaction?

The server would possibly see it as a sound transaction if we’ll ship the originalTransactionId as a substitute of the transactionId (utilizing it to name getTransactionInfoinAppStoreServerLibrary), however is that this one thing we wish to do? This can clearly not repair the issue as a result of the server tells the consumer to complete the transaction in any case, but it surely merely would not work.

Please, any recommendation or modifications to make to both Shopper/Server can be significantly appreciated

Thanks prematurely

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles