Search Unity

[Solved] Google Play Static Responses Could Not Be Found

Discussion in 'Unity IAP' started by wwcolter, Nov 15, 2017.

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

    wwcolter

    Joined:
    Nov 4, 2016
    Posts:
    28
    We are attempting to test IAPs on Google Play by using static responses. According to Google's docs, when using static responses:
    1. The app does not need to be published
    2. You must use the special reserved product ids
    3. You do not have to use a test account (as long as you're testing consumables or non-consumables)
    In the UnityPurchasing.OnInitialized, we verify that the 4 static test purchases (e.g. android.test.purchased) are available Products and their type is Consumable (by checking
    product.definition.type).

    When we attempt to purchase any of them, this is what we see in the adb logs:
    UnityIAP: Creating purchase activity
    UnityIAP: invoking callback
    UnityIAP: Constructing buy intent for android.test.purchased, item type: subs
    UnityIAP: Launching buy intent for android.test.purchased. Request code: 999
    UnityIAP: onActivityResult
    UnityIAP: Purchase canceled - Response: 2:Unknown
    UnityIAP: onIabPurchaseFinished: false
    UnityIAP: User canceled. (response: -1005:User cancelled)
    UnityIAP: Purchase response code:-1005
    Unity : OnPurchaseFailed: FAIL. Product: 'android.test.purchased', PurchaseFailureReason: UserCancelled
    The popup on device says "The item you were attempting to purchase could not be found."

    Other than the fact that it's failing to purchase, the part of the logs that stands out is item type: subs when this is clearly a consumable and we verified the product.definition.type is consumable.

    We have tried on multiple devices using test accounts. Our app is not published and we are not testing on signed builds on the Alpha channel - we are just testing on development builds and have tested both with and without signing the build using the release keystore.

    Has anyone been able to successfully test static responses with Google Play using Unity IAP? Any ideas here? The subscription type seems like it could be causing issues if it's attempting to purchase a subscription when the item is a consumable.

    Thanks,
    Colter
     
    Last edited: Nov 15, 2017
    NEVER-SETTLE likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I will look into this, and keep you updated.
     
    wwcolter likes this.
  3. wwcolter

    wwcolter

    Joined:
    Nov 4, 2016
    Posts:
    28
    Google got back to us and said:

    When using static testing, you should be signed onto the device with the primary email on your developer account only. You do not need to use a licensed test account (and should not use a licensed test account) if you are testing only with the reserved product IDs.​

    We haven't been able to test this yet but we will report back when we do.
     
  4. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Unity IAP does not support using the reserved product IDs required for Google's static response testing. This is due to the way Unity IAP tracks transactions internally to determine if they are duplicates. (So they should actually work once, but they never again.)

    This is our recommended way for testing Google Play purchases. It does require you to have a separate test account and actual product IDs in a beta or alpha test:
    https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
     
  5. wwcolter

    wwcolter

    Joined:
    Nov 4, 2016
    Posts:
    28
    Thanks for the response!

    If the lack of support for Google's static responses isn't noted in the docs, could it please get added? We spent hours trying to figure out why static responses weren't working as it is significantly easier than waiting hours for builds to go live on Google's alpha/beta channels.
     
    NEVER-SETTLE and nicholasr like this.
Thread Status:
Not open for further replies.