Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Haha I can't even remember what I did now without looking at the code as I think my brain turned to sponge today. requestProducts requestPurchase ...requestWine&Food more like!
Updated Ouya plugin, which would hopefully fix both blank screen and requestReceipts/requestProducts
To use it in your prepared projects, simply download Ouya.zip from Gideros Labs, unzip it and copy libs folder into your project replacing libgideros.so and libouya.so in both arm folders.
Uploading finished. USER_REQUEST_SUCCESS e9cxxx-xxxx-x-x-x-x-xxxxxxxxxxx PRODUCT_REQUEST_SUCCESS [1] => Table { { [id] => BacteriaUnlimitedPlay [name] => Bacteria Unlimited Play [price] => 399 } RECEIPT_REQUEST_SUCCESS [1] => Table { { [price] => 399 [time] => 1373020298 [id] => BacteriaUnlimitedPlay } About to make purchase After making purchase PURCHASE_REQUEST_FAILED User canceled purchase About to make purchase After making purchase PURCHASE_REQUEST_SUCCESS BacteriaUnlimitedPlay
I tested a cancel payment, then a ok payment - no black screen for either.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Great, I currently have worst connection possible, hopefully tomorrow it will be better and I could wrap up the plugin by removing all debuging stuff and move it to beta.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
I got as far as this too this morning (almost) but after adding the new libs to those arm dirs and building a new player .apk, when I uploaded everything ran ok but the controller buttons have stopped working? If I used the previous libs build the buttons work again - meh?
@MobAmuse you mean buttons or joysticks? Thats really strange, and should not be that way. Let me prepare the latest update so you could check if this bug is still on.
No it's neither of the libs? so it must be something else I've done to the new player that has stopped the controller buttons working - sorry. I will try and see what it is.
If you already have a working player/project, you can only copy and overwrite libs folder and GOuya.java file inside /src/com/giderosmobile/android/plugins/ouya/GOuya.java
Additionally I've also added exported Android project with preinstalled Ouya plugin, so if anyone wants to build player with their own package id to test IAPs, you can simply modify this exported project's AndroidManifest.xml to change package="com.yourdomain.yourapp" to match yours and build/export as you would with any Android apk (at least I think that should work )
After confirmation from someone that it works, I'll move OUYA to beta in the Labs
Using the newer 'prebuilt' player too I get error (stack traceback) now when doing ouya:init("mydevkeyID,appKey) in my app as if it's already done somewhere else? Reports in Output console 'Ouya already initialized'.
"If you already have a working player/project, you can only copy and overwrite libs folder and GOuya.java file inside /src/com/giderosmobile/android/plugins/ouya/GOuya.java"
...has broken my own player now too so it just bombs out when run on real Ouya
I got my own player working again with the new libs but I didn't use the new GOuya.java file in src this time so maybe there is something wrong with it - not sure? Really must go now
[Edit: But when I upload code to the working player with the new libs in it I get... 'Ouya already initialized' again doh! :P ouya:init... is called at the top of my own lua code so you must call it in your new libs too or something.
Updated Ouya plugin (again ) Fixed ouya already initialized error in libouya.so (and rebuilt OUYAPlayer.apk) Fixed OuyaPlayer project (I had a custom NDK builder attached to build plugins, removed it) You now don't need to copy libgideros.so if you are using latest Gideros Release 2013.06.1 And I've poked around GOuya.java but honestly, can't determine what can be wrong with it, but since I have added/modified it before, I'd like to make this current version of it work
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@SinisterSoft I knew I forgot something (like finish the featuring system of apps, will be implementing, once some more urgent things done ) but mention on the blog is guaranteed
Everything works as expected now so I vote move it to Beta! Thanks for your extended work on this ar2rsawseen and SinisterSoft, it's been totally mad last few days trying to do this and work on another project in tandem here at the same time! I reckon with a bit more work on my part I could publish my new Ouya app by Sunday to Ouya - hooray!
I am now having some trouble attempting to the read the receipt data to see if the user needs to purchase the app or not after say an uninstall situation. Any help appreciated. Currently I have a stored flag for the purchase which works but of course not for an uninstall and I know that is not the way to do it in practice as I should use the receipt to do it.
Actually from Ouya docs, receipts contains information about all user purchases, and sometimes when there is problem with internet or their server, you might not receive purchase successful event (as in if you missed it once, you won't get it again) thus it is your responsability to check receipts from time to time, to see if there are any new transactions you have missed.
Theoretically it is possible to create a layer on Android part to make it behave like google billing, to make it monitor all the transactions and notify user of new ones and raise purchase events on restore, so you could reuse your code. And that is what I will probably do, when I get to common IAP interface, that would be used across all IAP apis (including ouya).
But for now, basically you should check receipts on start, and see if you have already saved somewhere persistently receiptId then do nothing, if not then make a purchase and save receiptId, that would handle both restoring and missed purchases.
OK but how tho can you persistently store anything on android tho if the app gets uninstalled the stored data gets wiped anyway? I need an example as I'm just not getting this last bit of IAP at all. I would of imagined to make my app less hackable I dont want to save anything at all about the purchase, rather I should check the receipt/products purchased but don't know how. What if the player is offline too then that won't work either so then I must have to save something about the purchase for the player to continue with the app they already paid for. Arrrrrrgh my brain can't take any more of this! I'm a total noob to IAP can you tell
Comments
https://deluxepixel.com
Likes: MobAmuse
https://play.google.com/store/apps/developer?id=My+name+is+Originality
Likes: fxone, SinisterSoft
To use it in your prepared projects, simply download Ouya.zip from Gideros Labs, unzip it and copy libs folder into your project replacing libgideros.so and libouya.so in both arm folders.
Fingers crossed
P E R F E C T !!!
Uploading finished.
USER_REQUEST_SUCCESS e9cxxx-xxxx-x-x-x-x-xxxxxxxxxxx
PRODUCT_REQUEST_SUCCESS
[1] => Table {
{
[id] => BacteriaUnlimitedPlay
[name] => Bacteria Unlimited Play
[price] => 399
}
RECEIPT_REQUEST_SUCCESS
[1] => Table {
{
[price] => 399
[time] => 1373020298
[id] => BacteriaUnlimitedPlay
}
About to make purchase
After making purchase
PURCHASE_REQUEST_FAILED User canceled purchase
About to make purchase
After making purchase
PURCHASE_REQUEST_SUCCESS BacteriaUnlimitedPlay
I tested a cancel payment, then a ok payment - no black screen for either.
Likes: fxone, MobAmuse
https://deluxepixel.com
I currently have worst connection possible, hopefully tomorrow it will be better and I could wrap up the plugin by removing all debuging stuff and move it to beta.
Likes: SinisterSoft, MobAmuse
Gives be time to add better thrust smoke as the particle version takes too long when 4 players are on at once.
Likes: MobAmuse
https://deluxepixel.com
Thats really strange, and should not be that way. Let me prepare the latest update so you could check if this bug is still on.
(The buttons work while I am inside the actual IAP tho)
USER_REQUEST_SUCCESS 26xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
PRODUCT_REQUEST_SUCCESS
[1] => Table {
{
[id] => TT2D_UNLOCK
[name] => TropicalTreasures2Deluxe
[price] => 299
}
RECEIPT_REQUEST_SUCCESS
PURCHASE_REQUEST_FAILED User canceled purchase
Uploading finished.
USER_REQUEST_SUCCESS 26xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
PRODUCT_REQUEST_SUCCESS
[1] => Table {
{
[id] => TT2D_UNLOCK
[name] => TropicalTreasures2Deluxe
[price] => 299
}
RECEIPT_REQUEST_SUCCESS
PURCHASE_REQUEST_SUCCESS TT2D_UNLOCK
Likes: MobAmuse
[Edit:] No I can't now as I don't have the old libs - they are gone now :P
Will check from my time machine backup and try again.
Likes: SinisterSoft
If you already have a working player/project, you can only copy and overwrite libs folder and GOuya.java file inside /src/com/giderosmobile/android/plugins/ouya/GOuya.java
Additionally I've also added exported Android project with preinstalled Ouya plugin, so if anyone wants to build player with their own package id to test IAPs, you can simply modify this exported project's AndroidManifest.xml to change package="com.yourdomain.yourapp" to match yours and build/export as you would with any Android apk (at least I think that should work )
After confirmation from someone that it works, I'll move OUYA to beta in the Labs
Likes: MobAmuse
If I clean the project I get errors too.
If I attempt to export the .apk I get 'Errors occurred during the build'.
"If you already have a working player/project, you can only copy and overwrite libs folder and GOuya.java file inside /src/com/giderosmobile/android/plugins/ouya/GOuya.java"
...has broken my own player now too so it just bombs out when run on real Ouya
[Edit: But when I upload code to the working player with the new libs in it I get... 'Ouya already initialized' again doh! :P ouya:init... is called at the top of my own lua code so you must call it in your new libs too or something.
Fixed ouya already initialized error in libouya.so (and rebuilt OUYAPlayer.apk)
Fixed OuyaPlayer project (I had a custom NDK builder attached to build plugins, removed it)
You now don't need to copy libgideros.so if you are using latest Gideros Release 2013.06.1
And I've poked around GOuya.java but honestly, can't determine what can be wrong with it, but since I have added/modified it before, I'd like to make this current version of it work
Likes: SinisterSoft, MobAmuse
I didn't have any problem with any of the 4 joysticks in my game, all tested all ok.
I do notice that the joypad buttons sometimes repeat the keydown without being pressed again - like a keyboard repeat. Anyone else noticed this?
I might have to do my own key debounce routines for them before I release the game.
I'm going to mention Gideros in my press release, any chance of a feature on the website when it's ready?
Likes: gorkem
https://deluxepixel.com
Everything works as expected now so I vote move it to Beta! Thanks for your extended work on this ar2rsawseen and SinisterSoft, it's been totally mad last few days trying to do this and work on another project in tandem here at the same time! I reckon with a bit more work on my part I could publish my new Ouya app by Sunday to Ouya - hooray!
Likes: fxone, ar2rsawseen, SinisterSoft
Theoretically it is possible to create a layer on Android part to make it behave like google billing, to make it monitor all the transactions and notify user of new ones and raise purchase events on restore, so you could reuse your code.
And that is what I will probably do, when I get to common IAP interface, that would be used across all IAP apis (including ouya).
But for now, basically you should check receipts on start, and see if you have already saved somewhere persistently receiptId then do nothing, if not then make a purchase and save receiptId, that would handle both restoring and missed purchases.
Likes: MobAmuse, SinisterSoft