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.htmlpay 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.zipSome 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.