Search Unity

IAP restored each time game starts

Discussion in 'Game Foundation' started by Sukender_OB, Jan 15, 2021.

  1. Sukender_OB

    Sukender_OB

    Joined:
    Nov 14, 2019
    Posts:
    18
    Hi there,

    I have an IAP transaction with a payout giving some currency (1000 gold) and a (non stackable) item. Within the editor (fake store), everything runs fine. But under Android my currency payout is given each time I start the game! So I got 1000, then 2000, etc.

    Any idea why I get this strage behavior? Thanks.

    Note: I often test my game by wiping out data (Android). As a result, my game restarts at 0 gold, and immediately after the IAP purchase is restored (which is okay). Doing this, log says suspicious things:

    Clue 1
    Code (text):
    1. Unable to confirm purchase; Product has missing or empty transactionID
    2.     Purchasing.PurchasingManager:ConfirmPendingPurchase(Product)
    3.     GameFoundation.UnityPurchasingAdapter:CompletePendingPurchase(String)
    4.     GameFoundation.<SuccessfulPurchaseToDataLayer>d__64:MoveNext()
    5.     SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    6.     MonoBehaviour:StartCoroutine(IEnumerator)
    7.     GameFoundation.TransactionManagerImpl:FinalizeSuccessfulIAP(PurchaseEventArgs)
    8.     GameFoundation.<ValidateAndProcessSuccessfulPurchase>d__50:MoveNext()
    9.     SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    ...despite I got this just before:
    • Game Foundation : UnityPurchasingAdapter - purchase receipt: {"Store":"GooglePlay","TransactionID":"blahblahblah...
    • Game Foundation : TransactionManagerImpl - Game Foundation is confirming purchase of product 'my id' with the purchasing adapter.

    This "restore + unable to confirm" happens at each game start, regardless of the fact I wiped data or not.

    I can't be sure if this is IAP-related or GF-related.
    I even can't be sure this log message indicates a true cause or a false positive.

    Clue 2
    Another suspicious thing is that I got:
    Game Foundation : UnityPurchasingAdapter - Received purchaseEventArgs from IAP SDK.
    ... before:
    Game Foundation : GameFoundationSdk - Successfully initialized Game Foundation version 0.8.0.0

    Is this an issue, or not?
     
    Last edited: Jan 18, 2021
  2. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Hi Sukender_OB,

    Unfortunately, you are running into several known issues that may or may not be documented:
    • Game Foundation doesn't yet have a way to prevent multiple fulfillment when a non-consumable purchase is restored.
    • When Game Foundation initializes the IAP SDK, the IAP SDK will start processing past purchases immediately, regardless of whether Game Foundation has finished initializing. It looks like a problem, but really Game Foundation is queuing a purchase up for future processing when that "Received purchaseEventArgs" message gets logged. We will improve on that.
    • The "Product has missing or empty transactionID" error is a known issue in recent IAP SDK versions and they should have a fix out for that soon.
     
    Last edited: Jan 15, 2021
  3. Sukender_OB

    Sukender_OB

    Joined:
    Nov 14, 2019
    Posts:
    18
    Thanks for answering quickly, @richj_unity . This is not the kind of answer I like (!), but I understand and will try to build some kind of workarounds, if possible.
    1. Do you have any idea or clue that might help me working around these?
    2. Do you have any rough/approximate idea of next IAP & GF releases (just to know if I can wait or not)? even "days / weeks / months / years" would be an appreciable indicator. I swear I won't take this answer for a promise! ;)
    Thanks again.
     
  4. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Game Foundation doesn't have a set release schedule, but I would say unofficially that it's going to be a matter of weeks before the next patch.

    As for the"missing or empty transactionID" IAP SDK issue, I expect that one to be fixed much sooner. I believe they are testing a fix as I type this.

    Thanks for your patience!
     
    erika_d and Sukender_OB like this.
  5. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
  6. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Sukender_OB and erika_d like this.
  7. Sukender_OB

    Sukender_OB

    Joined:
    Nov 14, 2019
    Posts:
    18
    This 2.2.6 IAP update seems to fix my issue, at least in the current state of the project! Well I'd be happy to get a GF fix too, to make sure this doesn't re-happen later. I'm looking forward for your next releases! Thanks.

    ( But this was worth mentioning I guess ;) )
     
    richj_unity and erika_d like this.