Project Glbasic StoreKit (iOS, OUYA, OPENIAP)

Previous topic - Next topic

spacefractal

THIS PROJECT IS NO LONGER MAINTEAMED - LINKS CAN BEEN BROKEN

How to implement Project Glbasic StoreKit GlBasic:

---> Apple iOS <---

For using InApp Purchases for iOS, there is a lots of configuration that need to been done, but im wont explain it anything, because im thinks it will take for much time. So instead im adding some doc links instead.

1. Setup InApp Purchases in iTunes Connect:
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/13_ManagingIn-AppPurchases/ManagingIn-AppPurchases.html

pay attection to Entering Pricing and Availability Information about Product ID, which should uses the AppID and then the product name.

2. In the MKStoreKit-xcode folder in the project download is that way the x-code project should been implemted correctly (here tested with glbasic version 11.171 only, where the iCade issue was fixed).

3. You can look for more help here:

http://labs.freescapes.org/blog/tutorials/hitchhikers-guide-to-mkstorekit/ (etc more document required, but its still under dev).

---> OUYA <---

1. For developing to OUYA, you need your dev key as well the key.cer file. the dev key can been insert in inapp.gbas and the key.cer is need to been put into to assests/Android/key.der. Glbasic does NOT copy that folder automatic (because its outside the Media folder).

2. No PList is required for OUYA, but your need also add the SKU's you using in the OUYA Portal (make sure the sku you using for OUYA is unique, not to been used in other shops).

3. You should uses ANDROIDEXTRAS for game controller and of of course just added inapp support (howover its include in android.gbas as well in this project).

---> Google Play <---

1. First at all, you need to setup your sku, which you can read more about it here: http://developer.android.com/google/play/billing/billing_admin.html - Only managed items is supported right now.

2. You need to insert your APPLICATION KEY (NOT THE DEV ONE) in the InAppConfig_PublicKeys$(). Its a quite long key.

3. Setup your SKU just as you did in the Google Play console in the InAppConfig_SkuNames$() function. The sku names should not use same name as the other (due OpenIAP limit).

4. Implement rest as the functions, just as you would do on OUYA, WINDOWS (which is fake purchases, but nice under test).

---> The Glbasic Project It Self <---

Here is the glbasic project (version 1.0 beta 5):
https://www.dropbox.com/s/n7jm2ayc55etyy0/GlbasicStoreKit.zip

Some Notes:
- Also GLB_ON_PAUSE will been sendt when a progress is going (The StoreKit uses callbacks). Here its can checked if INAPP_STATUS$ contain something or not.
- INAPP_ERROR$ can been outputtet when a error have been happens (like a user cancel).
- If a Purchases have been a succes, then its would been sent to INAPP_PURCHASE$.
- Only Non Consumable is supported right now (to get thing working).
- iOS5.0 and up is required. That MKStoreKit does NOT work in 4.3 and below. That will not been changed at all.
- InAppPurchase_isAvailable() does no longer return 0 or 1, but a hashed value. They are different for different products (but same across all platforms).
- Do a fake product checking from InAppPurchase_isAvailable() to prevent hacking (etc allways return correct) for Android.

Those can been happens anytime in the runtime, so check its in your game loop, so you can progress your purchases.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

there is a nice itunes Connect tutorial here:
http://www.glbasic.com/forum/index.php?topic=6711.0

And remember, only Non-consumable can been used by now.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

mentalthink

Hi spacefractal thanks for the code, most than for use it, for learn, I like a lot see this Complex Codes, really learning this kind of programming GLBasic turns like a Beast...
Thanks a lot...
:nw: :nw:

spacefractal

yes its not for beginner really and require some configuration one to suit all shops (mainly you need to deal offline as well restoring required by Apple). Howover im do missing a example how to use. That about later.

Howover im have around tried to somewhere use the same functions AppGameKit did in the end, hence im did some comments about thier uses.

On Windows all purchases can been done, so the ui can been tested on that too.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#4
I'm looking if exist such kit on android....

EDIT, will try implement this one:
https://github.com/jlopez/ane-storekit

And also codning OUYA to the provider list, this one supports Amazon Appstore and Google Play. Property the two most important providers.

Admin, fell free to move this thread to Beta Test.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

bigsofty

Great stuff and very useful!  :good:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Falstaff

Oh wow good job..  if you could make a cross platform IAP lib that'd be amazing. I might be able to stick w/ GLB for a bit longer after all :) Will have to take a deeper look into this at some point.. it opens up a lot of possibilities. Thanks alot!

spacefractal

#7
It's designed to been poosible expanded to other provider and platform. That way I'm interface it's with glbasic functions.

On android there require some security (google play require public key in one java file. but have a idea by a java calls.

So if you can get it to work on iOS, it's should could works on android when done.

Configurations can been a bit pain.

Comon, admin, move it to beta test form :-)

Ps. Greedy Mouse uses that for iOS of course, just uploaded to them, but have a dev realease enabled.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Hi Space, just in case no moderator saw this post and the question about moving it to a different area of the forum, we can use the "report to moderator" button, so it gets faster on their hands. :good:

spacefractal

on Android, its seen OpenIAP is a better way doing inapp. That one supports various Stores (Like Google Play, Amazon Appstore and Samsung Apps), but not OUYA (which would try that later).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Alex_R

Thank you so much spacefractal. I was looking for something like this.  :good:  :good:  :good:

Ian Price

I came. I saw. I played.

spacefractal

im are currectly clean some things up, so its easier to understand what its going, and in a more logical order. Im will release a new beta later this week.

Im are currectly looking and implement OpenIAP to Android, which require some SKU configurations and public keys.

When done im will release the gbas project for easier understand and implement for you.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

the code will begin been more complect when im going to implemeted the Android as well OUYA stores as well (which require various keys). here im will integrate that into ANDROIDEXTRAS, which will share the same glbasic api (which need to change a bit). By now this is a start and works fine for iOS (android take some longer time than iOS, which was actuelly very easy due MKStoreKit).

Hopefully im a day in this or next week im will wipe up a little example of its use.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

im have just updated the first thread to include OUYA inapp purchases (SDK 4.0 and Android Extras is required, but the gbas project from there is NOT used, but instead using the java calls directly).

So for now its working for iOS 5+ and OUYA.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/