Search Unity

[Solved] Receipt Refresh on iOS

Discussion in 'Unity IAP' started by BrightAI, Mar 13, 2017.

Thread Status:
Not open for further replies.
  1. BrightAI

    BrightAI

    Joined:
    Apr 23, 2015
    Posts:
    10
    Hi,

    So we're trying to refresh our iOS receipts with Unity IAP, and calling the RefreshAppReceipt method of IAppleExtensions does, indeed, seem to give us a new base64 encoded string. However, when running that string through an ASN.1 decoder, it ends up with an identical ID in both the Transaction Identifier and Original Transaction Identifier fields, along with identical Purchase Date and Original Purchase Date, which Apple's Documentation seems to indicate should differ between refreshes. We're currently seeing this in the App Store sandbox, and is obviously trickier to test it with production purchases. Is there something unique in the sandbox environment in this regard.

    Additionally, do we need to call RefreshReceipt manually before calling the RestoreTransaction Method of IAppleExtension, or does calling that refresh the receipts under the hood?

    Further details:
    Platform: iOS
    Store Environment: Sandbox (Possibly a Sandbox only issue?)
    Unity IAP Version: 1.10.0
    Unity Version: 5.4.3f1
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @BrightAI

    That is expected behavior. Refreshing the receipt is basically re-downloading the receipt if it is missing. It will not make any changes to the receipt. Refreshing and Restoring are separate processes with different goals.

    It is not necessary to call RefreshReceipt if you are Restoring Purchases.

    We do have a manual page that shows sample code for Restoring Transactions for iOS:
    https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html
     
Thread Status:
Not open for further replies.