Hey guys,
I have been looking all day at in app purchases. But cant get my head around it. I managed to get it all set up so that you could buy the product, however the product doesn’t do anything (that’s 60p I owe my dad…). I was wondering if anyone had a template for something where the adverts get removed when the product is bought?
Please help!
Ollie [import]uid: 67534 topic_id: 24250 reply_id: 324250[/import]
Bump
[import]uid: 67534 topic_id: 24250 reply_id: 98009[/import]
Saw your tweet.
First - The IAP stuff you were doing should have been in sandbox mode and not actually charged you anything. To be safe make sure your dad’s account is listed as a test account.
As far as getting it set up, if you have it all set up on the IAP side (which you clearly do) what you could do is make a button to test the unlock function.
Create the button and when pressed call the function you’d normally call on a successful purchase to test safely. (And in the simulator.)
What you would likely do in your specific case is save a value to a file/database indicating adsShow = true or false.
When the app starts up load the value and if adsShow == true then init the ads, else do nothing.
Make sense?
Peach
[import]uid: 52491 topic_id: 24250 reply_id: 98010[/import]
You bumped while I was posting.
Two things;
-
Am moving this to IAP because it is about IAP.
-
If you bump a thread again and it hasn’t even been one hour I am going to have to tell you off. Don’t do that. At least let it move off the front page. [import]uid: 52491 topic_id: 24250 reply_id: 98011[/import]
Grr double post [import]uid: 67534 topic_id: 24250 reply_id: 98013[/import]
Oops sorry Peach! I was annoying with myself for uploading it to the market when it wasn’t working properly >.<
Oh and I forgot to say that it is on Android. Therefore I am kinda unclear on how to test it properly?
Edit*
I think I’m being vague as to what bit i don’t get.
The thing i really don’t understand is where to place the saveFile function.
do i place it here?
[lua] function savePurchase(product)
end
[/lua]
or in this bit?
[lua] if event.transaction.state == “purchased” then
savePurchase(“com.companyname.appname.product”) --you should enter here the product being purchased[/lua]
Thank you
[import]uid: 67534 topic_id: 24250 reply_id: 98012[/import]
OK, well you can disregard the test account part for Android then but the rest is valid.
Do you only have one product you are selling in that app? [import]uid: 52491 topic_id: 24250 reply_id: 98025[/import]
Edit*
Thank you very much for your help Peach, I believe i have it now though 
Ollie Brown [import]uid: 67534 topic_id: 24250 reply_id: 98028[/import]
Sorry, time difference - I went to sleep 
Glad to hear it sounds like it’s all sorted now, good luck with your project!
Peach
[import]uid: 52491 topic_id: 24250 reply_id: 98176[/import]