Updating game with IAP

I am looking to update my game with the option of removing ads. I have read the GS tutorial on IAP, but one thing confuses me in the tutorial.

"If a user has a game with a table already called PurchaseTable, they should rename it, save their game, and reload it so the system PurchaseTable can be created."

Do I have to do this in my updated game? If yes, can someone guide me on how to this, this is my first time setting up an IAP. Or do I just have to edit the Purchase Table in my updated game and don't bother about the renaming saving and reloading steps?

Comments

  • colandercolander Member Posts: 1,610

    Creator now inserts a table in all games called "PurchaseTable". If you have an existing game with a table that has that exact name you should rename it to something else.

    You should create your own IAP system/table to handle things between store purchases and your game. When you do just make sure you don't name you table "PurchaseTable" call it something else like "tblIAP".

  • pokapolapokapola Member Posts: 143

    So to be clear, I have to rename the Purchase Table inside my UPDATED game right? Not the Purchase Table inside the EXISTING game that has already been published to the stores?

  • colandercolander Member Posts: 1,610

    No you do not have to do anything to a published game. If you update your game at some point in the future you will have to deal with it then. If you don't have a table YOU named "PurchaseTable" then you have nothing to worry about. It's kind of like a reserved name because Creator needs it to run the new IAP system.

    Just make sure any table YOU name doesn't have that name and don't touch the one that GS puts in your game. Hope that al makes sense.

  • pokapolapokapola Member Posts: 143

    @colander Ahhh okay, thanks man!

  • pokapolapokapola Member Posts: 143

    ...okay...

    I thought I understood @colander explanation, but then I am confused again.

    1. I have already published a game, with a "PurchaseTable" in it. I did not have any IAP implemented in that game, so the "PurchaseTable" is left untouched.

    2. I am planning on making an update to that game. This time with an IAP implemented, for users to remove ads in the game.

    3. In this updated project, I have made a NEW table named "TBIAPforServer" because a table with the name "PurchaseTable" already exist in the earlier version. So I chose another name, for another table. I did not touch anything in the existing "PurchaseTable" in the updated project. The only thing I do is make a new table, by copying exactly the "PurchaseTable", and rename it to "TBIAPforServer".

    4. I then use the NEW table ("TBIAPforServer") to make the IAP.

    Is this how I am supposed to do it? Or is it wrong? I am really sorry to not really understand your explanation @colander but this is my first time setting up IAP and I'm really really confused :(

  • colandercolander Member Posts: 1,610
    edited December 2014

    You are over thinking it because it is a little confusing to start with. There are a lot of helpful videos here: and one called "New IAP Behaviours" it tells you everything you need to know.

  • pokapolapokapola Member Posts: 143

    @colander You're right, I think I am over thinking it. I will proceed on implementing the IAP first, if ever there's a problem, I'll ask again. Thank you for your help man!

  • ArmellineArmelline Member, PRO Posts: 5,369
    edited December 2014

    When you published your game, did you happen to personally create a table that you then named PurchaseTable? If you didn't personally create a table and name it PurchaseTable, you have nothing to worry about.

    GameSalad automatically inserts a PurchaseTable into your game. If you didn't make one yourself, the one that's there is the only one that's needed, and you need do no renaming of it.

    For the actually IAP functionality, there's a free tutorial template linked in my signature (that also allows you to do some level of testing before publishing).

  • pokapolapokapola Member Posts: 143

    @Armeline No I did not make any table with the name PurchaseTable in my previous project, and I did not modify the PurchaseTable that was inserted automatically by GS in the previous project.

    I have just submitted the Alpha version of my updated apk to Play Store. What I did in this updated project was, I renamed the PurchaseTable that was provided by GS, saved my project, and reloaded the project so that it generates the new PurchaseTable. I inserted the id for the non-consumable item in it, and followed all the steps required from the IAP official tutorial.

    I hope it will work once the Alpha version is available to be tested.

  • ArmellineArmelline Member, PRO Posts: 5,369

    @pokapola said:
    Armeline No I did not make any table with the name PurchaseTable in my previous project, and I did not modify the PurchaseTable that was inserted automatically by GS in the previous project.

    I have just submitted the Alpha version of my updated apk to Play Store. What I did in this updated project was, I renamed the PurchaseTable that was provided by GS, saved my project, and reloaded the project so that it generates the new PurchaseTable. I inserted the id for the non-consumable item in it, and followed all the steps required from the IAP official tutorial.

    I hope it will work once the Alpha version is available to be tested.

    That should work. There was no need to rename the PurchaseTable though. The original one and the new one will have been exactly the same.

  • pokapolapokapola Member Posts: 143

    @Armelline It workd fine in the Alpha version that I have tested. I have downloaded your template and I like it, so I'll use it in my game. Thanks a lot!

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    If you have not yet done so, I would do an ad hoc test and test it that way as well. Not just through the GS viewer.

  • ArmellineArmelline Member, PRO Posts: 5,369
    edited January 2015

    @KillerPenguinStudios said:
    If you have not yet done so, I would do an ad hoc test and test it that way as well. Not just through the GS viewer.

    Note that unless something has changed since I last tried it (entirely possible), you will not get accurate results using just an ad-hoc build when using an Apple device. For accurate in-app testing you need to publish your game to your Apple account via Apple's TestFlight system and install it on your phone that way.

    Android is a little more flexible.

  • pokapolapokapola Member Posts: 143

    @Armelline I have tested my app (Alpha version) with the template that you provide on Android. Any idea why everytime I tried to make a purchase, it always returns as Failed? And no pop-up appears whenever I try to make a purchase or restore a purchase.

  • ArmellineArmelline Member, PRO Posts: 5,369

    @pokapola said:
    Armelline I have tested my app (Alpha version) with the template that you provide on Android. Any idea why everytime I tried to make a purchase, it always returns as Failed? And no pop-up appears whenever I try to make a purchase or restore a purchase.

    PM me a screenshot of your rules in the purchase button and I'll see if I can spot anything. Sounds like it isn't making a purchase attempt.

  • LovejoyLovejoy Member Posts: 2,078

    Maybe try using the old IAP behaviors, i think they still work. Much simpler and easier. Someone please correct me if I'm wrong.

    Fortuna Infortuna Forti Una

  • colandercolander Member Posts: 1,610

    @Lovejoy I believe they still work but they are being depreciate and will be removed at some point. I haven't actually tried to test and publish with them to confirm they still work because at some point I will have to use the new system anyway.

  • pokapolapokapola Member Posts: 143

    I am so happy right now that I can barely type with my keyboard!

    After hours of looking at @Armelline template, and looking and searching on how to fix my problem, I finally found it...and I laughed in front of the mirror..at my own face.

    The root of my problem was I had entered the id for my products as an expression in the buy item behaviour. Stupid little mistake wasted hours of my life! LOL.

    Thanks too @colander and @Armelline for your guys advices! I really really really appreciate it.

Sign In or Register to comment.