Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIAP: gdx-pay extension for InApp payments #2333
Conversation
|
If I understood the core devs right, new extensions won't go in the core repo anymore. See gdx-ai. That being said you should probably clone gdx-ai and set your PR up as a "standalone extension". TBH, I haven't really looked at the code, because I'm not sure which value this extension actually adds. Currently there is only an abstraction layer and one implementation. I don't see any value in that so far. Who will implement the other backends? Since there is only one implementation, it doesn't prove that the abstraction layer is "good enough" for other backends. I think in total this would be a pretty neat and useful extension, however only with more implementations. I'd suggest you to try implementing one more backend, because I'm pretty sure that the core abstraction layer will get more "robust" or "generic" while doing that. After that people are more likely to use it, because currently, they might as well just go directly with OpenIAB. |
Not sure if I want to go into politics on that one. I actually haven't setup the "iap" branch putting the gdx-pay extension into the extensions directory of the libGDX project. Mario has set it up that way after discussing with other people involved including myself. Anyhow, I can either way on the extension. Also, I have no problem implementing the other backends too, but then I am doing this in my free time. In the end I have to pay bills like everyone else. If this ends up being a full-time endeavor maintaining the extension including all the backends I would rather charge money for it. I was hoping to get the ball rolling rather than doing it all on my own. There have been various forum topics about InApp payments for libGDX, so I believe I am not the only one interested in it. However, you are probably not aware of that.
I have looked at different IAP solutions provided by Google, Amazon, Apple iOS, Apple Mac Store and Steam. I also considered payment gateways including PayPal and Stripe. Then I looked at cross-platform implementations including Unibill, SmartIAP and OpenIAB to name a few. I believe the general design is pretty solid, but I would be glad to hear your feedback once you had a chance to look at it in some more detail. |
|
Daniel, let's keep the tone a little more friendly. @noblemaster is a long I'll try to review it tonight, only skimmed it so far. It looks pretty good!
|
I didn't intend to sound unfriendly. Sorry If I did.
That was probably a while ago. The opinions on "core-extensions" have changed recently. That's all I wanted to say.
That's what @badlogic told me how it would be, just a few days ago. That's why I was afraid that if you won't add more backends, nobody will in the end. |
|
"Since there is only one implementation, it doesn't prove that the abstraction layer is "good enough" for other backends." He did say he is looking for feedback. Also, cross platform support for IAP would be great and has been discussed before. "If I understood the core devs right, new extensions won't go in the core repo anymore." No one has said this. However, libgdx is already huge and isn't intended as a dumping ground for libgdx related projects. The core is generally cross platform, low level, and widely applicable functionality. If something isn't cross platform and could be a separate project, it probably should be. Sister projects can still be promoted, included in the setup UI, etc. |
just4phil
commented
Sep 14, 2014
|
hi.... i am a bit excited :) purchaseObserver and purchaseListener sound like they do the same or i dont really understand the conceptual differences? (i understand what they do in your code.... i only mean the naming) |
just4phil
commented
Sep 14, 2014
|
sorry.... seems like i am a bit blind.... where can i grab the latest sources to integrate this in my project for testing purposes? |
just4phil
commented
Sep 21, 2014
|
@noblemaster |
just4phil
commented
Sep 21, 2014
|
|
@just4phil (re-listener/observer): They could be the same too, although they have different methods inside. How would you go about it, i.e. change it? Code sample? |
|
@just4phil (re-OUYA applicationKey): yes, you could pass in the path to your file? Then insider the OUYA implementation you take the path and create the input stream as follows:
|
just4phil
commented
Sep 21, 2014
|
Cool.... I could try that |
|
@noblemaster Just a minor change: can you swap the arguments of the purchase method? PurchaseSystem.purchase("product_identifier", new PurchaseListener() {
...
});Feels more natural than the reverse. This way, if you have a very long listener, it's easier to see what you are purchasing. |
…purchaseListener!
|
@BlueRiverInteractive: agreed, you got it! Just refactored the method signatures. |
|
This comment is an inside joke. |
just4phil
commented
Sep 21, 2014
|
hm.... after forking/cloning libgdx and ant -f fetch.xml i have this error: The container 'Android Dependencies' references non existing library 'L:\Bitbucket__libGDX_fork\extensions\gdx-pay\gdx-pay-android-openiab\bin\gdx-pay-android-openiab.jar' there is no such jar.... what can i do? |
|
I'd like to make a request that we don't upload these sdk (openiab and ouya) binaries to the repo. |
|
I'm an idiot, i accidentially pulled this in. I don't want to rewrite history, and reverting the commit will get us into trouble down the road when we want to merge this commit. Everybody please fetch master into a new branch on your end and continue sending PRs. Sorry. I will stop to computer now... |
|
@MobiDevelop: agreed not to add the binaries. Having quite figured out "fetch" though. Adding the maven dependencies should do the trick!? |
|
@badlogic: no worries :) |
just4phil
commented
Sep 22, 2014
|
hmmm.... i try to start the tests on my ouya....i added the ouya intent to the manifest of the android test project.... this is the output: [2014-09-22 20:55:14 - gdx-tests-android] Android Launch! on my mobile it works well |
|
Yes, I am actually getting the same warnings when I run the tests as well. However, when I run PayTest on an Android device it works just fine. I added the projects as Android-library project and also as regular project to the gdx-tests-android. I guess removing or changing the project types around should make the warning to away... |
just4phil
commented
Sep 23, 2014
|
i can run all the gdx-test on my ouya after adding the ouya-intent to the manifest. |
I guess you mean "PayTest.java"? Not sure what error you are getting but you definitely have to pass in the OUYA store parameters such as in PayTest.java: config.addStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA, new Object[] {
"<OUYA developerID String",
"<Path to OUYA applicationKey"
});If it still doesn't work there might be another error. What log output/error messages are you getting? |
just4phil
commented
Sep 24, 2014
|
well i built a PayTestOUYA.java file and added it to the gdx-tests..... but that doesnt work. [2014-09-22 20:55:39 - gdx-pay-android] Could not find gdx-pay-android.apk! any ideas? so i will try to just change your PayTest.java and see if that works for ouya |
|
You shouldn't create your own PayTestOUYA.java file. It would defeat the purpose of being cross-platform and all. You should add all your changes to PayTest.java. Once you upload the Android tests to your OUYA-device it should all magically work as long as all the parameters for your OUYA-store are set within PayTest.java. Anyhow, it's possible that PayTest.java doesn't open the OUYA-store for you. Please make sure:
Regarding the warnings; I got those too but it works fine for me. What actually happens (console output, display on OUYA) when you run PayTest on your OUYA device? Can you post those logs? |
just4phil
commented
Sep 24, 2014
|
here it is: 09-24 07:24:30.180: D/GdxPay/IAP(1187): Failed to locate purchase manager for OUYA-IAP (gdx-pay-android-ouya.jar file not installed) |
|
OK, I checked: looks like you are running quite an older version! You might want to checkout the latest release from the master branch! Anyhow, from the error it looks like it's able to instantiate OpenIAB via reflection but fails for your OUYA project. Looks like the reflection code is fine (if not, fixup IAP.java for OUYA!) so I would look at how OpenIAB is added to the tests, given it works fine!? |
just4phil
commented
Sep 24, 2014
|
should be the latest version... i pulled yesterday and implemented my pull requests then....
|
just4phil
commented
Sep 24, 2014
|
i just changed OUYA IAP Backend like this:
but this didnt help.... |
|
I am looking at this:
That's an old version. Line 75 is now in the comments... In any case, sorry, just noted your pull requests! Merged the OUYA update. |
noblemaster commentedSep 14, 2014
I managed to get a first draft for the gdx-pay extension (cross-platform InApp payments for libGDX) ready for review. This is less of a pull request but more of a request for feedback. Please comment - Thanks :-D
What's currently implemented (extension projects):
This test demonstrates how the payment system is used in your platform-independent code:
To integrate into Android, you will need to add corresponding hooks to your activity (look for the 3x "// InApp:"):
Screenshot running PayTest.java on an Android device:
