Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Closed] When purchase consumable product, iOS receipt field "in_app" is empty

Discussion in 'Unity IAP' started by yuewahchan, Nov 23, 2016.

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

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    In backend receipt validation, there are some iOS receipts' field in_app is empty. Who's know how to reproduce this ?
     
  2. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    We've been having this issue on our app. Many sources, including the 3rd party verification example in the Unity IAP docs (found here: https://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html) assume that an empty "in_app" field in the receipt is a hacking attempt. We have found that that is not always the case and are looking for a work around now. Specifically, when a user attempts a purchase with the "Ask-To-Buy" feature turned on, as soon as the purchase is approved, the ProcessPurchase method will be called and the receipt will be empty. In this case, the purchases were legitimate but there is no receipt to verify against.
     
  3. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @yuewahchan & @mike-ww

    It looks like we may have an issue with the Ask to Buy feature on iOS. We are looking into this issue and will update here when we have more information.
     
  4. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    @ap-unity

    Is there a bug written up somewhere that we can follow the progress on to check when it is done?
     
  5. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    @ap-unity

    Since last posting, we've seen some more strange behavior with Ask to Buy purchases that might be relevant to fixing this bug.

    When confirming an Ask to Buy purchase remotely and still in the app, processPurchase is called as expected and the flow goes as expected. However, when a parent confirms the purchase remotely and the child is outside the app, when the app is started again both processPurchase and the DeferredPurchaseListener are called, creating weird behavior.

    In both scenarios, however, the transactionId returned in the outer JSON by the Unity IAP system DOES NOT match the transactionId found in the in_app array of the iOS receipt, making it incredibly hard to accurately validate the receipt.

    In addition, when the parent confirms the app on the same device the purchase was requested by typing in their password, processPurchase never gets called and the purchase hangs in deferred limbo forever, triggering the DeferredPurchaseListener on every Unity IAP initialization.

    We have a lot of purchases that come through the Ask to Buy system, so we would be happy to provide any information that might be helpful to getting these issues solved!
     
    ap-unity likes this.
  6. cruelbob

    cruelbob

    Joined:
    May 26, 2014
    Posts:
    20
    We have same issue.
     
  7. blindgoat

    blindgoat

    Joined:
    Oct 24, 2012
    Posts:
    31
    @ap-unity

    Any update on this issue? Anyone we can talk to about this?
     
  8. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    @ap-unity

    As of Unity version 5.5.1p2, Ask to Buy purchases are triggering OnPurchasedFailed when remotely verified and the user is still in the app. Previously on Unity version 5.4.3p4, purchases would behave as mentioned in my other post.
     
    Last edited: Mar 8, 2017
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @yuewahchan, @cruelbob, @blindgoat,

    We are still working on tracking down the cause of this problem. I apologize for any inconvenience this issue has caused.

    @mike-ww,

    Thanks for the additional information. Did you also update the plugin version?
     
  10. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    @ap-unity We are running on the 1.10.0 of the Unity IAP plugin. Issue persists
     
  11. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Hi,

    I'd like to chime in with this same problem, however, we're seeing it on occasion on non-Ask-to-Buy purchases.

    In the particular case that I'm looking at, we have a user that:
    • Purchased a consumable (€0.99) and successfully validated
    • 7 mins later, purchased a consumable (€19.99) - returned receipt had an empty in_app array
    • 20s later, purchased a consumable(€4.99) and successfully validated
    • 30s later, tries to repurchase the €19.99 consumable, but it doesn't work (error is UserCancelled, so if there's only one way that returns, then they stopped the purchase themselves)
    This is from a customer that has made repeat purchases for the same amounts before, so I'd err on the side of no foul play on their end.

    I can provide the receipts for all 3 purchases if necessary. Again, to stress, this is a normal purchase, not Ask-to-Buy

    cc @ap-unity
     
  12. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @mike-ww, @Nicolas1212

    I discussed this issue with the IAP team again today and one suggestion that came up was to refresh the receipt if you get an empty in_app array. We are still investigating the underlying cause, especially with the Ask-to-Buy feature, but try that and please let us know if it was any help in this situation.
     
    Nicolas1212 likes this.
  13. mike-ww

    mike-ww

    Joined:
    Sep 28, 2015
    Posts:
    8
    @ap-unity

    we thought of that as a potential solution as well. Unfortunately, refreshing the receipt yields the exact same result - an empty in_app array is returned
     
  14. KJoanette

    KJoanette

    Joined:
    Jun 8, 2013
    Posts:
    59
    Has there been any news on this recently?
     
  15. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Hi @ap-unity,

    Has there been an update in relation to ask-to-buy on this? We're still having issues using Unity IAP 1.11.4

    I can provide logs from clients affected if it helps

    Thanks
     
  16. ap-unity

    ap-unity

    Unity Technologies

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

    Unfortunately, we don't have any updates on this issue. We are still investigating this.
     
    Nicolas1212 likes this.
  17. Exploderad

    Exploderad

    Joined:
    Oct 3, 2013
    Posts:
    5
    Is there any updates on this issue yet? Also, is there a bug that we can keep track of?

    Thanks!
     
  18. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Nicolas1212, @Exploderad

    We have not been able to reproduce this issue on our end, but we have some reports that hint it may be an issue on Apple's end.

    I would encourage you to submit a bug report with Apple:
    https://developer.apple.com/bug-reporting/

    Similarly, we will report this to our contacts at Apple.

    If we find any additional information, we will make sure to post an update in the IAP changelog or our forums.
     
  19. Exploderad

    Exploderad

    Joined:
    Oct 3, 2013
    Posts:
    5
    Hi!

    Here's a little bit more information about what we see on our end though Unity's IAP

    When trying to purchase an IAP item from an account set up as "Ask to Buy" we get an OnPurchaseFailed event call with PurchaseFailureReason : Unknown. No popup or notification on the parent device to approve any purchase done on the child device.
     
Thread Status:
Not open for further replies.