In-App Purchases not being consumed in Android/Google Play

ferzhengferzheng Member, PRO Posts: 40

Hello everyone,

I am currently facing a problem that is making me frustrated, and i would like to ask you for some help if possible please!
I followed every step in the Cookbook, but when i test the games and i purchase whether a consumable or a non consumable, there are two problems:

First, if it is a non consumable, the attribute does not change! For example, a character that should become available does not, the same happens with the consumables, i can purchase them, but they (coins and lives) are not added after the purchase! :(

Second, when i purchase a consumable, it seems that the consume attribute does not work because after that i cannot purchase anymore (i tap on them but nothing pops up), and what´s worse, it seems that Google recognises that the gmail i used to test the IAP has already bought the item and does not let me buy again, never more.

This is the table of the consumable

These are the configurations

This is the table of the non-consumable

These are the configurations

I would really appreciate if you could give me a hand with this problem.

Thank you!!!

Comments

  • SummationSummation Member, PRO Posts: 476

    @ferzheng

    You can try to set up test purchases to see if your programming is correct.
    Here's some documentation:
    http://developer.android.com/google/play/billing/billing_testing.html

  • ferzhengferzheng Member, PRO Posts: 40

    @Summation

    Thank you for your reply!
    I have tested them, and there is where i realised all these issues happened. I really want to believe that it is a bug, but i could not find any other posts related to this issue, which makes me feel i am the only one.

    Best wishes!

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685

    Just at a quick glance I can see a few mistakes.

    First one is you should not enter any info in the purchase table other than the IAP ID. You have entered prices and names, these should be blank.

    You also appear to have 2 separate tables called PurchaseTable. You should only have one. Use the same table for both consumables and non coms.

    You also have a timer set to "every" this is going to fire that same rule 33 times a second. Fire it once and consider changing it to "after" 0.1 secs.

    You might any to expand and screen shot your rules so we can see what's inside the expression behaviours too. Right now we can't see what row or column you are looking for in both the buy behaviour and the "if purchased" rule.

    Unfortunately it's 23.30 here and I'm off to sleep but I'll pick up your reply in the morning if someone else hasn't helped you out in the mean time. (Unless what I have said already doesn't fix the issue).

    *remember you should only have one purchase table and when you have deleted the duplicate, go Back to each rule and re-do the rule to ensure you have the current and valid purchase table and not the old deleted table.

  • ferzhengferzheng Member, PRO Posts: 40
    edited May 2015

    @gingagaming

    Thank you very much for your reply!
    I have deleted all useless values in the PurchaseTable, leaving only the ID and the Consumable/Non-Consumable integer. I have changed the "every" 0.03 secs to "after" 0.1 secs.

    I forgot to say that those screenshots were from two different games, one has only Consumables and the other one has only Non-Consumables, which means i have only one PurchaseTable in each game.

    Here i attach the new screenshots, i hope they are not blurry!

    Consumables Game:


    Non-Consumables Game:

    Another thing that is rare for me are the second tables called IAPs which i saw in the tutorial video of the new IAP system in the cookbook but don´t know why they are necessary.

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685
    edited May 2015

    First thing to check then would be the word "purchase"

    Check this by clicking the word "purchase". If it opens the expression editor and its typed in there, delete it, close the expression editor and then type it again in the field AND NOT THE EXPRESSION EDITOR. This is a common mistake.

    Next, turn off you your IAPs table rule. Both the update and save rule. You don't need this (only if your tracking purchases) it confuses things and also causes serious memory leaks ( as you as updating a table cell value by adding a value to a table searched value (tablecellvalueTABLE1,1+10) this is a bug in GS. So for now turn it off or remove it.

    I also can see that you are trying to consume a non consumable. Remove this too. You can't consume a non consumable!

    If all of the above doesn't work, stick a "display text" behaviour on the same page as your IAP and change the text to something other than white. Then tell the display to read a table cell value. Make one read the IAP ID (1,1) and make another read the current purchase status (1,5). Run this in creator and see if the display value of the IAP ID is displayed or missing. If missing, you have a logic issue elsewhere in your page for sure. If it displays, then load the APK on to your device and see if the purchase status changes to un purchased, puchased and back to un purchased when making the purchase.

  • ferzhengferzheng Member, PRO Posts: 40
    edited May 2015

    @gingagaming

    I followed all your recommendations and tried it first in the consumable game:

    First, you were right, i did not insert the word "purchased" directly, so i did.
    Then, i turned off the IAPs table and save table.
    At last, I made 2 actors display both things you asked and sent the APK to my phone to test and apparently they worked!!!

    But there is this one last thing i think is not working, it is that when i purchase lives, if i go out of the game and re-open it, they disappear. So i thought about adding a Save Attribute behaviour after the Change Attribute behaviour (to add the new lives):

    But when i tested it again on my phone they still did not save.

    I then decided to insert a Load Attribute first, thinking it would be the solution:

    But after this one, the things got even funnier lol, each time i consumed the lives, closed the game and reopened it, the lives were renewed.

    As regards the turning off of the IAPs table, were you referring it in the consumables or in the non-consumables game too?

    I thank you very much for all your support and i hope you could help me solve this last one!

    All of the best,,

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    You need to save the game.Lives attribute every time it changes. So when a player loses a life, you need to save the attribute.

    Mental Donkey Games
    Website - Facebook - Twitter

  • ferzhengferzheng Member, PRO Posts: 40
    edited May 2015

    @NipaDidIt

    Thank you very much for your tip! I managed to solve this issue in my game with consumables!

    But when i do the same with my other game with non-consumables it seems not to work, i mean, when i Save Attribute after the characters are unlocked, i quit the game, open it again and i would have to restore them again every time.
    Here i attach a screenshot showing the save attribute:

    Would there be any solution for this?

    Thanks!!

  • SummationSummation Member, PRO Posts: 476

    @ferzheng said:
    NipaDidIt

    Thank you very much for your tip! I managed to solve this issue in my game with consumables!

    But when i do the same with my other game with non-consumables it seems not to work, i mean, when i Save Attribute after the characters are unlocked, i quit the game, open it again and i would have to restore them again every time.
    Here i attach a screenshot showing the save attribute:

    Would there be any solution for this?

    Thanks!!

    Are you loading the saved attribute when you start the game?

  • ferzhengferzheng Member, PRO Posts: 40
    edited May 2015

    @NipaDidIt
    @gingagaming
    @Summation

    Thank you very much for your support! I have configured the IAPs correctly, it seemed to work perfectly after all. But it seems that there is a bug (or maybe the configurations) that is not allowing me to purchase lives in a new twist i made to the consumables game.

    Instead of making "Lives" as the IAPs, i made Coins for players to purchase with real money and then with those coins purchase the lives. The problem i cannot understand is why they do not save when i purchase the Lives with the Coins even when the Save Attribute behaviours are implemented.

    Here is a screenshot of the configurations of the real money IAPs (Coins):


    And this is how the Coins are used to purchase the Lives:

    When i purchase the coins as IAP, i get out of the game, re-enter, and they are still there.
    But when i use them to purchase Lives, i quit, re-enter, and something weird happens: the values of the Coins and the Lives switch places!

    (For example, if i purchase 100 coins, i quit the game and re-enter, they are still there. Then, i use those 100 coins and purchase 10 lives of $10, resulting in 0 Coins and 10 Lives, i quit the game and re-enter, the value of the Coins become 10 and the Lives become 0!

    Has anyone experienced something like this before?

    I also wanted to say that all these help made me realise how friendly and helpful all you guys from the GS forum are, i am really thankful!!

Sign In or Register to comment.