Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] An open ended InAppPurchase command?

Author
Message
DC Sound System
8
Years of Service
User Offline
Joined: 14th Feb 2016
Location:
Posted: 5th Feb 2020 17:42
So I'm making a game where all the levels are basically just text files that the game reads. I'm planning on selling new text file levels as I make them. I was originally just going to package a bunch together and have an installer put them in the game directory. And you'd just buy this installer off my website.

But I'm wanting to use the InAppPurchase function (seems less clunky). And I can't seem to figure out how to implement it. Keep in mind, I've never used the InAppPurchase commands before...

But what I was hoping for was that I could load a bunch of level files on to google play or iTunes and then somehow scan all of the available Products with the App and if there is a new one to buy, then ask the player to buy it. Is this possible? Also, is there a command that can scan my Google Play or iTunes for new content (doesn't seem to exist)?

The author of this post has marked a post as an answer.

Go to answer

Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Feb 2020 08:41
This post has been marked by the post author as the answer.
Just an idea, not actually tested:

Set up 100's of in-app products in each store, call them something like level 1, level 2, level 3, and level 4 etc.

Host your levels on a website/server, and have your website/server return the number of levels that are available each time the user opens the app.

Have your app programmatically display the number of levels available based on the number returned from the website/server

Something like:

For i = 0 to noOfLevelsAvailable
//Display in-app purchase button for each one
Next

Or:

If (noOfLevelsAvailable >=1)
//Display in-app purchase button for level 1
EndIf

If (noOfLevelsAvailable >= 2)
//Display in-app purchase button for level 2
EndIf

This would require you to hard code all of the in app products in your app but you can do that even if the levels aren't available yet. If you added say 50 in-apps in each store, add those IDs to your app and then when you get close to those 50 being available you make another app update that lets you have another 50. Depending on how frequently you release levels will determine how frequently you need to uodate your app to allow for a future bunch of levels.

I don't believe its possible to scan the stores to see what in-apps ids are available. You can't return a full list.

I also don't know what the limit is for the number of in-apps allowed in each of the stores for a single app.
OryUI - A WIP AGK2 UI Framework
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Feb 2020 08:57
One more thing to consider. If you set up the first version for 50 levels and add in all of the in-app purchases you need to not loop beyond 50 because if the server returns 60 are available that first version won't know the ids for level 51+ and may crash

So something like this if using the above example

For i = 0 to noOfLevelsAvailable
If noOfLevelsAvailable <= 50
//Display in-app purchase button for each one
EndIf
Next

With the second version of the app you can increase that if you've set up the in-apps in the stores

For i = 0 to noOfLevelsAvailable
If noOfLevelsAvailable <= 100
//Display in-app purchase button for each one
EndIf
Next

If there is a limit of in-apps (I'm sure there would be) then maybe selling bundles of levels would 1. be more attractive to the buyer and 2. Let you release a lot more levels and keep people playing for longer so in-app 1 would give the player levels 1-5 and in-app 2 would give the player levels 6-10 etc.

The above examples would work for bundle packs just return the number of bundles available from your website i.e. noOfBundlesAvailable = 3
OryUI - A WIP AGK2 UI Framework
DC Sound System
8
Years of Service
User Offline
Joined: 14th Feb 2016
Location:
Posted: 6th Feb 2020 18:53
Cool! Thanks, that's a great idea.

Login to post a reply

Server time is: 2024-11-22 11:06:22
Your offset time is: 2024-11-22 11:06:22