Android IAP Definitive Guide

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • You wanted it, now you have it!

    A complete and (almost) definitive guide to In-App Purchases inside Fusion for Android! An expansion on existing tutorials kindly created by the community, this is the complete guide with text and screenshots from top to bottom. I will be following up with a video on this but at least you have this material to be going off for now.

    I hope you all find it of use! Comments, suggestions and feedback always welcome.

    Files

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Great! Yes, I hope it does come across easily enough for everyone. I can always modify it, so any feedback is welcome. I hope you find it of good use :)

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Ok! :) I have now followed the guide through, and everything seems to be working fine (I see the items appearing in the list object). The only problem I have is that when I try to buy an item I get a Google Play pop up with red text that reads "The Publisher can not buy this item". I have added a test account, and before I test my app I made sure to go into the google play store on my device to log into that account instead of my developer account. Any idea what I am doing wrong?

    Steam games: Please login to see this link.

  • There IS slight confusion with this even on the official Google/Android forum. It's not the Play account that is logged in, it's the phone's actual email account. So the new test one you setup needs to be the default (first) one ever on the device. Adding it later, even setting it as default won't class it as default. The only way around this here is to hard reset the phone to factory and when you set it back up, only add that test account for Gmail/Google.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Yes I read something like this, that seems extremely unpractical though toward the developer from Googles point of view? :O I heard there may be some other solution by rooting the android device and removing the profile with some program, but I dont know how safe rooting is? I have heard some stories of peoples devices getting broken after rooting :s But maybe its for the best to NOT have the developer account on your device? I mean is there any reason why you would want to have the dev account on the device?

    Steam games: Please login to see this link.

  • I wouldn't try risking rooting. You have the potential to brick your device. Just backup your data and do a hard reset. It is indeed a Google flaw. One they never addressed even to this date.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Yes I read something like this, that seems extremely unpractical though toward the developer from Googles point of view? :O I heard there may be some other solution by rooting the android device and removing the profile with some program, but I dont know how safe rooting is? I have heard some stories of peoples devices getting broken after rooting :s But maybe its for the best to NOT have the developer account on your device? I mean is there any reason why you would want to have the dev account on the device?

    in your cellphone, sign up for another google account, don't sign in your phone with the google account use for your developers account.

    It won't let you pay for the app. Which is dumb LOL. Why would google even care, they charge you for for each transaction anyways, isn't that more money for them anyways? :D

    I like how ouya has it setup, that if you are the owner of the app or game the payment goes ahead but it doesn't charge you anything.

    :D

    Please login to see this link.Please login to see this link.
    Take a course in Clickteam Fusion Please login to see this link.
    Youtube Please login to see this link.
    Please login to see this link.

  • I reset my device so now I can test inapp purchases :) They seem to work now, but I must have done something wrong because they inventory is acting a bit strange. I have attached the example of how my mfa here: Please login to see this link.
    Also here is a screenshot of the test after a purchase: Please login to see this link.

    On start of the app I have two items in the "store inventory", they are "test_sword" and "test_shield". I also have a button to buy a "test_sword" and another button to consume a "test_sword". What happens when i buy a "test_sword" though is that in the player inventory I see a "test_SHIELD" being added instead of a "test_sword" and in the store inventory two more instances of "test_sword" and "test_shield" is added (so now the total number of store items are 4).

    Also when I consume the "test_sword" i bought I see that one more "test_shield" is added to the player inventory (?). Also the total store inventory is increased to two more items so they are now a total of 6 (3 "test_sword" and 3 "test_shield".

    I guess I must be doing something wrong in my mfa? :P

    Steam games: Please login to see this link.

  • Outcast, you are reading the query and adding the articles to the list object (inventory and purchase) but never reset before to do so.

    so in line 8 and 10 you need to reset the lists before fill them again, right?

    for the rest your example is consistent and should work.

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • Ok FVivolo, I have updated the example: Please login to see this link.

    Now the list does not seem to refill, but the purchase still buys the "test_shield" item even though in the events it is supposed to buy the "test_sword" item.

    Steam games: Please login to see this link.

  • Ok after some more testing it seems I actually get the right item, it is just the list object that updates wrong. I made a new example: Please login to see this link.

    Any idea why the list object does this? And are the list objects really necessary or can you just get rid of them?

    A problem I have though is that the application seem to stop responding many times and I get an error it needs to close. Especially on consuming items.

    Steam games: Please login to see this link.

  • The list objects are not necessary at all, this is just a feedback mechanism so you can see the result being pulled from Google's servers when querying. You need to ensure you QUERY the server but you don't need to list. It's just purely for testing purposes.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Fantastic! I wasn't expecting something like this so soon. I was just coming to the forums today to exhaustively look for any information on IAP's, and here is this great guide!!!! I couldn't have asked for more. Thank you! :)

  • I also wanted to ask- So if I want to do an unmanaged product, everything in this guide would be the same except I wouldn't have to do any of the inventory query stuff, right? It just seems it would be much easier to manage what items the player does or doesn't have inside the app rather than doing so much back-and-forth with Googleplay. The only downside is that the items wouldn't be account-wide.

  • I agree it is more useful to just handle the data yourself. However, you will still have to QUERY the inventory so your app knows what the user can/can't purchase at any given time...

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • HELP! Anytime I drag the IAP object into a game, it has errors and can't make an APK. As soon as I delete the IAP object, it works again. Here is what the error report says:

    -compile:
    [javac] Compiling 337 source files to C:\Users\Scott\AppData\Local\Temp\And9723.tmp\bin\classes
    [javac] C:\Users\Scott\AppData\Local\Temp\And9723.tmp\src\Extensions\InAppControl.java:15: package Util does not exist
    [javac] import Util.Security;
    [javac] ^
    [javac] C:\Users\Scott\AppData\Local\Temp\And9723.tmp\src\Extensions\CRunInAppAndroid.java:284: method does not override or implement a method from a supertype
    [javac] @Override
    [javac] ^
    [javac] C:\Users\Scott\AppData\Local\Temp\And9723.tmp\src\Extensions\CRunInAppAndroid.java:303: bUnicode is not public in Services.CBinaryFile; cannot be accessed from outside package
    [javac] file.bUnicode = true;
    [javac] ^
    [javac] C:\Users\Scott\AppData\Local\Temp\And9723.tmp\src\Extensions\InAppControl.java:417: cannot find symbol
    [javac] symbol : variable Security
    [javac] location: class Extensions.InAppControl
    [javac] if (!Security.verifyPurchase(signatureBase64, purchaseData, dataSignature)) {
    [javac] ^
    [javac] C:\Users\Scott\AppData\Local\Temp\And9723.tmp\src\Extensions\InAppControl.java:593: cannot find symbol
    [javac] symbol : variable Security
    [javac] location: class Extensions.InAppControl
    [javac] if (Security.verifyPurchase(signatureBase64, purchaseData, signature)) {
    [javac] ^
    [javac] 5 errors

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!