Are there any in app purchase tutorials for android out there?

I followed the documentation Unreal has provided, but it is REALLY limited, and the explanation isn’t very clear. First off, it is using the Unrreal Match 3 example to show how it is done, which is fine. But, it only covers one item. What if you have multiple items? Do you have to set them up separately in the same manner, or can they all be lumped into an array? I tried looking at the blueprints themselves within the project, and I am still very confused. How do I make sure that the purchased items stay in tact (i.e. if a user uninstalls my app and reinstalls later). Simply saving a bool variable as true or false doesn’t seem like the best option, as the variables coincide with the save file (or am I missing something?). So if the save file gets deleted, how do I make it so my users don’t have to repurchase non-consumable items? (Such as removing ads).

I should note that this is my first time doing in-app purchases, so my understanding of all of this is very limited. A decent tutorial or more info on the documentation would really be helpful. Does anyone know of a good tutorial that covers this?

Thanks for responding. But, I am still a bit lost. Where do I insert this logic into? The store screen I created? Or some place else? The Unreal Match 3 example was passing a bunch of info back and forth between the store screen, confirmation screen, and the game instance (or at least that was what I took away from it). Your set up looks far less complicated, though. You mentioned setting up my license key and app ID. Do you mean the section in the project settings, in google play developer console or somewhere else?

Sorry for all of the questions. This is totally uncharted territory for me, and this is the last thing I need to set up in my game.

If you are getting prices for your sale items you put all IDs in an array, even if it’s just one it belongs in an array.

When you are making a purchase you make a purchase with only one ID.

When you request to restore in-app purchases any non-consumed purchases are returned.

Make sure the user is logged in before attempting any purchase, leaderboard, or achievement calls.

When looking for the blueprint nodes make sure you choose the ones with the blocky icon as shown circled in red, and NOT the function node.

Don’t forget to setup your Google Play License key and Games App ID. I don’t have a link to this information immediately but it’s pretty easy to find.

It’s much less complicated than their example. I used this code in my store front widget. Any section that retains variables and allows timers should work. So macros, functions, and function libraries for example would not work. Widgets and actors should. Yes, I was referring to the project settings about your Google license.

ok, a few more questions. Are these nodes connected to a custom event for each of them, or something else? On the sections with the ForEachLoop, what am I processing through those?

I tried this using custom events, and it is still not functioning.

Custom events will work.

It’s worth mentioning that you cannot test from within the editor. You must compile the app and push it to your phone. Also, you must submit a testing version to your Google Developer Console within Alpha or Beta testing. The version number must match the version number as what you’ve uploaded to your Google Developer Console. You can then make as many changes to your local copy as you want long as the version number matches what’s online.

You will also need to setup purchases and testers on your Google Developer Console. Refer to Google support for that, because it changes frequently. It’s pretty easy to figure out on your own though.

Using Read In-App Purchases is fairly simple. You provide an array of purchaseIDs you wish to gather information on. When successful, you process the ForEachLoop breaking each result and taking information from the structure.

Restore In-App Purchases is the same thing except you don’t provide an array of IDs, and it returns back only purchases made with receipt data such as cost, dates, so on.

Is this array being created from my google play list of in-app purchases? And is this the array I am then pulling information from? Or do I set up the array locally?

I already have uploaded the compiled beta version to the developer console and have tested it on my device from there. I have two options in my store currently. One is a simple remove ads option. The other is a “season pass” that removes ads and allows all non-consumable dlc to be free. When I hit either button in my store widget (while testing on my device), nothing happens.

There are several problems you may be running into. You’re using your package name as an array string, which you should be using your in-app purchase ID. In your Google Developer Console visit your 'In App Products" and add a new pin in your array for every product, containing the ID(not the name).

Secondly, you aren’t even processing anything in your loop. See more information on For Each Loops here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums12-_For_Each_Loop

Lastly, print string will only be visible on your phone if you are compiling a debug/non-distribution version.

Some of your problems are unrelated to in-app purchases. If you have a specific question to anything other than in-app purchases(eg: for each loops) start a new question please. There is plenty of information here to get started.

Sorry. I read the Your Product part of your array in your screenshot wrong. I replaced the project names with the product IDs. I understand what a forEachLoop does. What I am questioning is, do I need to set the return information to a new array (such as prices)?

As I said before, this is the first time I have done IAPs in Unreal, so forgive me for not understanding it completely on the first try.