Search Unity

[Solve] Google Play: Static test response returns "publisher cannot purchase this item" error

Discussion in 'Unity IAP' started by Xanjos, Mar 29, 2017.

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

    Xanjos

    Joined:
    Dec 5, 2014
    Posts:
    10
    I'm not sure whether this is a Google Play related issue or not but I am using Unity IAP so I might as well make a thread on here. Anyway, I've implemented Unity IAP into my game and I'm trying to test whether it works when I set the store to "Google Play" by using the static test responses provided by Google themselves (https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static) before testing with the actual IAP items that I've already set up on my developer console but for some reason whether I test my IAP implementation with the "android.test.purchased" reserved id I keep getting this error message saying that as a publisher I cannot purchase this item (See attached sceenshot below for details) which I believe isn't supposed to happen with static responses since you can use them to test Google Play IAP functionality in your app/game while logged in as your developer account without having to create a separate test account. I have no idea why it's doing this so I'm not sure whether this is an error on Google's part or if Unity's IAP implemention doesn't like Google Play's static responses. Sidesync_capture_20170212174202_1 (2).jpg
     
  2. ap-unity

    ap-unity

    Unity Technologies

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

    Unity IAP doesn't detect anything about the product ID you are using; it simply passes the id to the store and accepts the returned value.

    I'm not sure if this is the case. Can you show documentation somewhere that specifies that test accounts aren't required for static responses?

    Could you try setting up a test account and seeing if that resolves this issue?
     
  3. Xanjos

    Xanjos

    Joined:
    Dec 5, 2014
    Posts:
    10
    Here's the link to the documentation that shows that I don't necessary need to use a test account if I'm testing with static responses only (https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static) but I might try setting one up and see if there's any difference.
     
    NEVER-SETTLE likes this.
  4. Xanjos

    Xanjos

    Joined:
    Dec 5, 2014
    Posts:
    10
    Hey there,

    Just giving a quick update since I finally had time to sort this out after months of leaving it in the backburner:

    First thing I did was to set up a test account on my device to see if these static responses will work with them (In this case I borrowed my brother's account). Ended up receiving a DF-RPC-01 error (and this was after I set the correct permissions for my brother's account to buy IAP items without being charged any money just in case).

    Then the other day I stumbled upon this thread which seems to having a similar problem to mine. I won't go into too much detail but what the original poster discovered was that only the product ids that he defined in his Google Play Developer Console would work whereas the reserved test ids didn't for some reason. So I decided to replace the test ids in my code with my actual product ids and lo and behold, I finally get Google Play IAP working in my game.

    To summarise, I honestly have no idea why these reserved static testing ids didn't work (despite Google Play's documentation stating that they can be used by developer accounts to test IAP functionality without having to sign in with a separate test account) so I'm thinking maybe it might be something to do with Unity IAP's implementation of the Google Play billing library (where only real ids can be used) but other than that I'm just glad this problem is finally over and done with.
     
Thread Status:
Not open for further replies.