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 / In-App purchasing

Author
Message
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Dec 2012 00:06
I see we have the commands:

Quote: "In-App Purchasing

InAppPurchaseSetTitle ( szTitle )
InAppPurchaseAddProductID ( szID )
InAppPurchaseSetup ( )
InAppPurchaseActivate ( iID )
GetInAppPurchaseState ( )
GetInAppPurchaseAvailable ( iID )"


Is there any information on how to use them? I don't see any example. I'm still using 1083 so I am not completely up to date yet.

Does anyone know anything about the process from the store end? Do you just put some files aside to be downloaded if the user decides to make a purchase? And is it complicated or pain free

And what if it is not media they are buying, they are just unlocking some feature, is there a standard way to handle this or do we have to come up with our own encryption/key system?

I have decided to give away my next app for free and try the in-app purchase route, I think this will be a better strategy for monetising our games, people like to download free stuff

Will be grateful for any information.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Dec 2012 10:15 Edited at: 18th Dec 2012 10:17
Matty, I don't know so much about the store side but I did some IAP in Squashies World and this was all unlockable content.

InAppPurchaseAddProductID ( szID ) - the string is the product ID in the store
InAppPurchaseSetTitle ( szTitle ) - the string is a title you set in the store which is unique to the IAP
InAppPurchaseSetup ( ) - call this after the previous two to finalise the purchase setup for this IAP
GetInAppPurchaseAvailable( iID ) - the ID is an integer value for each purchase starting at zero in the order you created the IAP's in your code
InAppPurchaseActivate ( iID ) - call this to begin activation (IE. when the user clicks "Purchase" button
GetInAppPurchaseState() - use this to check when the purchase attempt is comlete then call GetInAppPurchaseAvailable( iID ) again to check for success

Example:


EDIT: I use a set of globals or a UDT for the unlockable content and check the state of those purchases when the game loads. Then I set the value of those globals based on the purchase availability. In game I just check what's available from those globals before allowing the user access to it.


this.mess = abs(sin(times#))
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 18th Dec 2012 10:34 Edited at: 18th Dec 2012 10:35
Hmmm we need also a command to check and restore what you previously bought. For example if you remove your app from the telephone for many different reasons, like repair, after when you reinstall the application you need to recover the in-app you made, to do this you need a check and a restore command.

Also what about the download of data? if when i buy i have to get a new level set, how i do ?

http://www.7ravenstudios.com
https://www.facebook.com/pages/7-Raven-Studios/102567824318?ref=hl
https://www.facebook.com/groups/391126020940838/
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Dec 2012 10:35 Edited at: 18th Dec 2012 10:43
GetInAppPurchaseAvailable( iID ) will do that as long as you are logged into the store using the same store ID.

Quote: "Also what about the download of data? if when i buy i have to get a new level set, how i do ?"

I guess I would include any new media or levels in the game to begin with and only make it available once the purchase is available.

If you want to add stuff later just add them to an update that allows the purchase of the new items.


this.mess = abs(sin(times#))
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Dec 2012 16:40
Thanks for that baxslash, very much appreciated

I will use this for my next app.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Dec 2012 19:07
Quote: "Also what about the download of data? if when i buy i have to get a new level set, how i do ?"

You could download extra data, such as new levels and such from your website after the purchase is complete I would have thought. You would need a bit of php to save the info to a database, to ensure people who have purchased can re-download the content if they need to.

7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 22nd Dec 2012 16:32
@DVader: hmmm the file is not uploaded to the Apple section ? there is a section on their server where you can upload the downloadable in-app data files and also should be pretty easy to do with some simple command.

http://www.7ravenstudios.com
https://www.facebook.com/pages/7-Raven-Studios/102567824318?ref=hl
https://www.facebook.com/groups/391126020940838/
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Dec 2012 21:19
But as far as I can see AppGameKit does not have a command to download in-app data files from Apple right? I suppose this does not happen auto-magically
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 23rd Dec 2012 03:48
I have thought about this for a while. I didn't know there were in-app commands so that might change my thought.

I was going to use a PHP mysql database to store all users info. Then hook the php to paypal. Once a confirm was received put a true value in the column for the unlocked content. Instead of downloading the content, AppGameKit could run a check in the DB to see if it is unlocked and then unlock the content on the phone. I would push new content locked in an update with some freebies so people would download it.
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 23rd Dec 2012 13:42
@Kobaltic, i doubt if you make like this that Apple will approve your application. Maybe on Android but i'm not sure also because in-app is always a way for them to make money, if you make payment via paypal they will not get anything and also doing like this can't offer customer support from the vendors.

http://www.7ravenstudios.com
https://www.facebook.com/pages/7-Raven-Studios/102567824318?ref=hl
https://www.facebook.com/groups/391126020940838/
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 23rd Dec 2012 16:10
true. I wasn't really thinking about apple. They all need their share.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Dec 2012 16:42
Kobaltic you definitely won't get approved by apple for that practice!
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Dec 2012 23:34
I only mentioned that idea as a way of remembering purchases you have done through apple, not as the actual in purchase mechanism. Although I am surprised there is no way to do it from the site as well, as they must store the data themselves. I agree, I doubt Apple would allow it as they tend to keep tight control of this sort of thing.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Dec 2012 22:17
There are two types of in app purchases, consumable and non-consumable (known on Android as unmanaged items and managed items respectively). Non-consumable items are bought once and remembered by Apple so if the user tries to buy it again they don't get charged again. This would be suitable for unlocking more levels in an app, for example you ship the app with 20 levels but only the first 10 can be played until the in app purchase commands return true for a purchase succeeding to unlock the rest.

Consumable items can be bought more than once and the number of times it has been bought must be recorded by you, either in a file (not recommended) or on a server (recommended). This would be suitable for coins or some kind of in game currency that is used to buy/unlock game content. Again you can ship the game with everything in it so no need to download extras after the purchase, you just allow access to the already present content.

The reason you shouldn't store consumable items in a local file is if the app is uninstalled then the local file will be deleted, and if they ever reinstall the app it will wipe out whatever coins they had bought.

Login to post a reply

Server time is: 2024-11-24 06:27:05
Your offset time is: 2024-11-24 06:27:05