Search Unity

Amazon Product.receipt always NULL when testing.

Discussion in 'Unity IAP' started by nomo, Sep 9, 2018.

  1. nomo

    nomo

    Joined:
    Apr 4, 2013
    Posts:
    8
    So I've recently integrated Unity IAP (version 1.20.0) into my mobile game projects (all using Unity 5.6.6f2) in place of our older plugins. The only blocking issue I've encountered is that regardless of how I test Amazon android builds I never seem to have valid receipt data (Product.receipt is always NULL).

    Code (CSharp):
    1. Product product = storeController.products.WithID( productId );
    2.  
    3. if( product.receipt == null )
    4.     Debug.LogWarning( "The product provided does not have receipt data: " + productId );
    5. else
    6. {
    7. // ...set up the SubscriptionManager.
    8. }
    I've used both the Amazon App Tester app as well as posting a build to Amazon's live test system. The purchase appears to complete successfully. I'm wondering if this is to be expected with builds that aren't live (available for release and signed by the Amazon Appstore)? This issue is particular significant for me as our main motivation for integrating Unity IAP was to gain support for subscriptions. And per the IAP demo code, it appears that valid receipt data is required in order to use the SubscriptionManager class. Any insight would be appreciated!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I will check with the team here
     
  3. nomo

    nomo

    Joined:
    Apr 4, 2013
    Posts:
    8
    Much appreciated!
     
  4. nomo

    nomo

    Joined:
    Apr 4, 2013
    Posts:
    8
    Any new insight on the issue?
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm that you are testing with a Subscription that is not expired? when we tested Amazon using the App tester app, if we buy a subscription product, we can always get a valid receipt if this product is not expired.Perhaps you are purchasing a consumable product, and it is suppose to have no receipt on next app initialization. Also, when you say it appears to complete successfully, can you confirm on the users account?
     
  6. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
    Hi Jeff, I'm Noah's partner. The subscription is not expired and is set up correctly as a subscription (not consumable). I can also confirm the the sub completed successfully and is in my user account/Appstore Library as an active subscription that expires in the future.

    Can you confirm which SKU/ID we should be using for purchasing as well as getting back receipt data? Should we only be using the 'Subscription Period' sku or only the parent subscription sku?
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want the parent subscription sku. We are continuing to investigate here. If you continue to have issues with this, it may be an issue on our side that we would need to address. I'll try to keep this thread updated with our progress.
     
  8. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
    Found more information here: https://answers.unity.com/questions/1367978/unity-iap-amazon-subscriptions.html

    So we have been using the child ID for purchasing and getting receipt data. Are you saying we should use the parent for both? Or should we purchase and get sub meta data with the child sku and reciept data with the parent sku (as the link above suggests)?
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The link looks to be correct.
     
  10. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
    I'll give it a test. Thanks for the info.
     
  11. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
    It looks like the states come back correct using the parent sku, but the dates are still invalid/null.
     
  12. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
  13. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
  14. SparkHSH

    SparkHSH

    Joined:
    Apr 3, 2013
    Posts:
    12
    The release notes below suggest Amazon subscriptions are fully supported, unless I'm missing something. Is this information not correct?

    An update is available for Unity IAP, v1.20.0.

    Additional support for subscription:

    • This version now supports upgrading / downgrading subscription tiers for Google Play store.
    • We now bring feature parity of subscription feature to Amazon store, providing extended information about IAP subscription products
     
  15. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    I just confirmed it with the team.
    Yes, SubscriptionManager in Unity IAP v1.20.0 supports Amazon. Sorry for the inaccurate message and out of date forum.
    But it only has limited support since the receipt returned from Amazon doesn't have enough information we can use.
    So for now, it can only detect if a subscription is valid or not.
    For more information about SubscriptionManager, please refer to IAPDemo.cs. You can find it at 'Assets\Plugins\UnityPurchasing\script\'.