there are three types of iaps i dont know the exact names but might be they are managable, unmanagable and subsciption based one of the type can be purchased only on once and can not be purchased second type in whatever condition and other one can be purchased as much time as much user likes but it can not be restored so in terms of coins you have to go with second option which can not be restored unless you store all the data of user in ur own server however users are already aware by this and if you dont want to setup ur own server it is perfectly fine and most of the games are also not setting their server
I had setup a file for "stars" in my game using datasaver, as stars.earnt and stars.purchased so i could record what they earn through achievement and what they purchased.
I was just worried, if they re-install the app somewhere that i would have to restore what they had paid for. But if that is not an issue, then i will just store it locally as above.
there are three types of iaps i dont know the exact names but might be they are managable, unmanagable and subsciption based one of the type can be purchased only on once and can not be purchased second type in whatever condition and other one can be purchased as much time as much user likes but it can not be restored so in terms of coins you have to go with second option which can not be restored unless you store all the data of user in ur own server however users are already aware by this and if you dont want to setup ur own server it is perfectly fine and most of the games are also not setting their server
Does someone know what version of Billing API is supported by Gideros?
In case of supported API v3, it means all products will be managed and how can I send a consumption request to Google Play (for example I purchased 5 coins and during gameplay 2 are used, but 3 are available for using)
I assume if Gideros only supports Billing API v2, every Android app must manage its own comsumible in-app products (saving in local disk)
if isAndroid ==truethen
googlebilling:setPublicKey("My long Key")
googlebilling:addEventListener(Event.REQUEST_PURCHASE_COMPLETE, onRequestPurchaseComplete)
googlebilling:addEventListener(Event.PURCHASE_STATE_CHANGE, onPurchaseStateChange)end
1) I can now make a purchase in my app. it shows google. and i have a payment record in the development console, and it even deducted the payment from my test users account (not a problem but dont know why.).
The problem is, im not getting anything back to say its processed. Even when i put Alert dialogs. i have worked out its the Intents/Events. But i dont know what is the standard codes being sent from GOOGLE. Im using the script in this thread to handle the events, but it uses different event codes to my standard exported manifest file.
Most common problem to this is that googlebilling is a global object, but you define a local function as event listener, thus you make purchase somewhere outside the scope and it does not launch it
I dont understand why the Lua code has "PURCHASE_STATE_CHANGED" and the Manifest has "PURCHASE_STATE_CHANGE" (without the "D" at the end)... is that intentional or am i just going loopy ?
i dont understand if the Manifest is listening for < action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" / >
But the Lua code is Listening for and event of : googlebilling:addEventListener(Event.PURCHASE_STATE_CHANGE, onPurchaseStateChange)
Why are they different codes? or are they totally not related to each other? the way im reading this, is the Manifest needs to listen for a service, then the Lua code Listens for the event...
@ArtLeeApps well you may say they are unrelated. Basically the code in manifest does not exactly go straight to Lua. It calls a subclass of Google Billing, which calls the main Billing Class, which calls a native function in C++ which enqueues event, which gets received by binding class and dispatched to Lua. the name Event.PURCHASE_STATE_CHANGE (without D was used for consistency with other Gidros events), like it's not Event.COMPLETED, it's Event.COMPLETE
A Noob mistake. i copied the IAP Gideros code to its own file (so it was neat). so the calls to start the listeners never happened. I have now put the function in main, and started the listeners there also, so if the game is running, its got ears on. i have now successfully made a purchase and its added my stars to the game etc. thanks again.
During testing, i had made a managed purchase (remove_ads). that worked fine. Then i went to my google console and refunded the transaction(as my partners account is still being deducted money even though she is on the test user list.. but thats not the issue..)
I then uninstalled the game, and reinstalled it. The game has ads again (as expected) BUT, then i go to purchase remove_ads again, and it says i cant as i already have purchased this.
Wouldnt google reset that purchase if i refunded the money ? * i did buy this when i was still trying to get the purchasing to work, so that may have something to do with it.
@atilim or @ar2rsawseen so is there no way to find out what products have been already purchased by the user? in case a user buys something in the app then removes and re-installs the app. Or does this just not work for gideros player?
This is what i'm doing.
local function onRestoreTransactionsComplete(event) print("RESTORE_TRANSACTIONS_COMPLETE EVENT") for key,value in pairs(event) do print(key,value) end end
Comments
If you have an app that allows you to purchase coins. eg. you have made 10 purchases of 20 coins.
when you RestoreTransactions(), do you get 200 ? or do you get 10 records of 20 coins ?
Given that the product will be the same for each purchase.
http://artleeapps.com/
Bubble Adventure - Colors
there are three types of iaps i dont know the exact names but might be they are managable, unmanagable and subsciption based one of the type can be purchased only on once and can not be purchased second type in whatever condition and other one can be purchased as much time as much user likes but it can not be restored so in terms of coins you have to go with second option which can not be restored unless you store all the data of user in ur own server however users are already aware by this and if you dont want to setup ur own server it is perfectly fine and most of the games are also not setting their server
Likes: fxone
Ah ok. that makes sense.
I had setup a file for "stars" in my game using datasaver, as stars.earnt and stars.purchased so i could record what they earn through achievement and what they purchased.
I was just worried, if they re-install the app somewhere that i would have to restore what they had paid for. But if that is not an issue, then i will just store it locally as above.
Many Thanks
Likes: hgvyas123
http://artleeapps.com/
Bubble Adventure - Colors
Does someone know what version of Billing API is supported by Gideros?
In case of supported API v3, it means all products will be managed and how can I send a consumption request to Google Play (for example I purchased 5 coins and during gameplay 2 are used, but 3 are available for using)
I assume if Gideros only supports Billing API v2, every Android app must manage its own comsumible in-app products (saving in local disk)
Ok i have this working, i can buy items using my girlfriends test phone
But, now i can run my app in the Gideros Studio Player, as its looking for Googlebilling.
how do you fix that, or does this mean from here on, if i do anything to my app, ihave to export it and run it in eclipse ?
http://artleeapps.com/
Bubble Adventure - Colors
ive used this method to get around it.
To handle the Notification and GoogleBilling.
In Main:
Is this the way to go ?
Now i can run this in the Player and my Phone.
http://artleeapps.com/
Bubble Adventure - Colors
http://artleeapps.com/
Bubble Adventure - Colors
1) I can now make a purchase in my app. it shows google. and i have a payment record in the development console, and it even deducted the payment from my test users account (not a problem but dont know why.).
The problem is, im not getting anything back to say its processed.
Even when i put Alert dialogs.
i have worked out its the Intents/Events. But i dont know what is the standard codes being sent from GOOGLE. Im using the script in this thread to handle the events, but it uses different event codes to my standard exported manifest file.
eg.
Manifest File snippet:
Lua Code From this Thread:
http://artleeapps.com/
Bubble Adventure - Colors
I dont understand why the Lua code has "PURCHASE_STATE_CHANGED" and the Manifest has "PURCHASE_STATE_CHANGE" (without the "D" at the end)... is that intentional or am i just going loopy ?
http://artleeapps.com/
Bubble Adventure - Colors
Is there similar sample code for StoreKit in the forum?
Thanks
http://www.giderosmobile.com/forum/discussion/1689/ios-in-app-purchasing-first-attempt-and-first-problem#Item_36
http://www.giderosmobile.com/forum/discussion/1604/in-app-purchase-example#Item_23
http://docs.giderosmobile.com/reference/plugin/StoreKit
sorry for my dumbness on this one, but..
i dont understand if the Manifest is listening for < action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" / >
But the Lua code is Listening for and event of :
googlebilling:addEventListener(Event.PURCHASE_STATE_CHANGE, onPurchaseStateChange)
Why are they different codes?
or are they totally not related to each other?
the way im reading this, is the Manifest needs to listen for a service, then the Lua code Listens for the event...
Sorry again
http://artleeapps.com/
Bubble Adventure - Colors
Basically the code in manifest does not exactly go straight to Lua. It calls a subclass of Google Billing, which calls the main Billing Class, which calls a native function in C++ which enqueues event, which gets received by binding class and dispatched to Lua.
the name Event.PURCHASE_STATE_CHANGE (without D was used for consistency with other Gidros events), like it's not Event.COMPLETED, it's Event.COMPLETE
Likes: hgvyas123
Thank you for the explanation.
it wasnt making sense
8-}
http://artleeapps.com/
Bubble Adventure - Colors
A Noob mistake.
i copied the IAP Gideros code to its own file (so it was neat). so the calls to start the listeners never happened. I have now put the function in main, and started the listeners there also, so if the game is running, its got ears on.
i have now successfully made a purchase and its added my stars to the game etc.
thanks again.
http://artleeapps.com/
Bubble Adventure - Colors
During testing, i had made a managed purchase (remove_ads). that worked fine.
Then i went to my google console and refunded the transaction(as my partners account is still being deducted money even though she is on the test user list.. but thats not the issue..)
I then uninstalled the game, and reinstalled it.
The game has ads again (as expected)
BUT, then i go to purchase remove_ads again, and it says i cant as i already have purchased this.
Wouldnt google reset that purchase if i refunded the money ?
* i did buy this when i was still trying to get the purchasing to work, so that may have something to do with it.
any thoughts ?
http://artleeapps.com/
Bubble Adventure - Colors
This is what i'm doing.
local function onRestoreTransactionsComplete(event)
print("RESTORE_TRANSACTIONS_COMPLETE EVENT")
for key,value in pairs(event) do print(key,value) end
end
googlebilling:setApiVersion(2)
googlebilling:setPublicKey("my_key")
googlebilling:requestPurchase("android.test.purchased")
googlebilling:restoreTransactions()
and i get
__target table: 0x5f7df958
__type restoreTransactionsComplete
__userdata userdata: 0x5f7ce728
responseCode ok
no info about what purchases the user has...