inApp purchase for dummies?

Hi,

So I am coming to the end of developing my little game for kids, and I would like to add inApp purchase for new levels. These are already included in the bundle so no need to use a server or anything like that. All I require is a button that will unlock the levels and remove a little padlock to indicate this. The sample code is good and so are the docs but I still am having trouble understanding.

Would I have, lets say, a boolean stored in my app, and if a purchase was made I would then turn it on and allow the levels to be played, or does the inApp purchase take care of this for me???

Is there any more tutorials out there that may help me on my way??

Many thanks
Chris
[import]uid: 10697 topic_id: 8252 reply_id: 308252[/import]

Hi Chris,

i would do it as you wrote.

a boolean stored in my app, and if a purchase was made I would then turn it on and allow the levels to be played,


i am playing arround with the inApp purchase right now…
and i am going to do it this way…

Maybe not the best solution…

[lua]function transactionCallback( event )
local transaction = event.transaction
if transaction.state == “purchased” then
print(“Transaction succuessful!”)
–>> SAVE MY VALUE TO FILE: TRUE
elseif transaction.state == “restored” then
–>> SAVE MY VALUE TO FILE: TRUE
elseif transaction.state == “cancelled” then
–>> SAVE MY VALUE TO FILE: FALSE
elseif transaction.state == “failed” then
–>> SAVE MY VALUE TO FILE: FALSE
else
print(“unknown event”)
–>> SAVE MY VALUE TO FILE: TRUE
end

– Once we are done with a transaction, call this to tell the store
– we are done with the transaction.
– If you are providing downloadable content, wait to call this until
– after the download completes.
store.finishTransaction( transaction )
end[/lua]

[import]uid: 9592 topic_id: 8252 reply_id: 29448[/import]