BASIC

Author Topic: Project Glbasic StoreKit (iOS, OUYA, OPENIAP)  (Read 12311 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
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.
« Last Edit: 2014-Apr-24 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: iOS Inapp purchase using MKStoreKit
« Reply #1 on: 2013-Sep-01 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3357
  • Integrated Brain
    • View Profile
Re: iOS Inapp purchase using MKStoreKit
« Reply #2 on: 2013-Sep-01 »
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:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: iOS Inapp purchase using MKStoreKit
« Reply #3 on: 2013-Sep-01 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: iOS Inapp purchase using MKStoreKit
« Reply #4 on: 2013-Sep-02 »
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.
« Last Edit: 2013-Sep-02 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2600
    • View Profile
Re: iOS Inapp purchase using MKStoreKit
« Reply #5 on: 2013-Sep-02 »
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)

Offline Falstaff

  • Mr. Polyvector
  • ***
  • Posts: 148
    • View Profile
Re: iOS Inapp purchase using MKStoreKit
« Reply #6 on: 2013-Sep-02 »
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!

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: iOS Inapp purchase using MKStoreKit
« Reply #7 on: 2013-Sep-02 »
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.
« Last Edit: 2013-Sep-02 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4177
    • View Profile
    • Portfolio
Re: iOS Inapp purchase using MKStoreKit
« Reply #8 on: 2013-Sep-03 »
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:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: iOS Inapp purchase using MKStoreKit
« Reply #9 on: 2013-Sep-03 »
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).
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Alex_R

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
    • Axro Digital
Thank you so much spacefractal. I was looking for something like this.  :good:  :good:  :good:

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4143
  • On the shoulders of giants.
    • View Profile
    • My Apps
Moved as per request.
I came. I saw. I played.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
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.
« Last Edit: 2013-Sep-05 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3602
    • View Profile
    • Space Fractal
Re: Ongoing Betas: Project Glbasic StoreKit
« Reply #14 on: 2013-Sep-08 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.