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.

Newcomers AppGameKit Corner / In app purchase restoration question

Author
Message
Midget Blaster
AGK Developer
7
Years of Service
User Offline
Joined: 7th May 2016
Location:
Posted: 17th Apr 2017 09:57
I have an in app purchase that doubles all coins earned after purchasing. When purchased, an integer called doublecoinstate is set to 1. My question is after purchase, do I have to save it into memory, or is it automatically saved if a user turns off the app and on again? Does InAppPurchaseSetup() take care of this? It is not a consumable purchase.
Here is my code
programming is ace
User Banned
Posted: 18th Apr 2017 20:39
Interesting.

As we do really need to turn off our devices and indeed our apps will loose the memory anyway. So I assume its all done by Google Store themselves by sending our device details to them when purchase and identify if Purchased when run the initialisation InAppPurchaseSetup() process.

So it retrieves info from that command that.... "Does this App for this device already been paid for"

Or indeed do we have to handle it?

Interesting..
programming is ace
User Banned
Posted: 18th Apr 2017 20:45
If it doesn't work like I logically suggested, then suggest on the Paid routine, to "amend" a file in the media folder for the app by changing a BIT from 0 to 1 for paid and and each time run the app, to check this file and that BIT.

If its 0 then not paid, if its 1 then its paid.

programming is ace
User Banned
Posted: 18th Apr 2017 21:00
Given myself an idea.

On starting the app.

Write some code to check the Checksums and validity of each of the media files in the folder.

If the checksum is different to the version we send out and first installed - then someone has been messing about with the media contents,

there say, Whoops - cannot load this App, please uninstall and re-download the app for free???
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 18th Apr 2017 22:33
doublecoinstate will have its initial value when you close the app, unless you save it

Check out the help on this command:
https://www.appgamekit.com/documentation/Reference/Extras/InAppPurchaseRestore.htm
PSY LABS Games
Coders don't die, they just gosub without return
programming is ace
User Banned
Posted: 18th Apr 2017 23:00
There you go - a command to go with, it must change some registry (windows) or core component in other devices to determine

Thanks for input Psy
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 19th Apr 2017 01:34 Edited at: 19th Apr 2017 01:42
I might be wrong, but I guess the command pulls info about purchased items from the Apple Store.

Google market also provides some RESTORE_TRANSACTIONS request, which seems to be executed when using InAppPurchaseSetup(), as the command help suggests.

If the data about purchased items was stored locally, it would be gone if the user reinstalls Windows or sets his smartphone back to factory settings.


So about the doublecoinstate question:
1. Check which items user has already purchased when your app initializes
2. Set doublecoinstate to 1 if user purchased it
3. Use doublecoinstate in your code to reward the user with 2x coins
PSY LABS Games
Coders don't die, they just gosub without return
Midget Blaster
AGK Developer
7
Years of Service
User Offline
Joined: 7th May 2016
Location:
Posted: 19th Apr 2017 09:45
In my loop I have this :
if ( GetInAppPurchaseAvailable(0) = 1 )
doublecoinstate = 1
endif
Will that be good enough? I don't want to release my app and have iAP broken so Im just really careful
JohnnyMeek
10
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 19th Apr 2017 10:15
I save the info to a local file.

Yes people could hack it, just don't make the filename something obvious. You need the player to still be able to play the full version of your game when they are off line. You can never stop the cheaters.

Login to post a reply

Server time is: 2024-03-28 11:51:28
Your offset time is: 2024-03-28 11:51:28