Since the promo from the Amazon, we decided to rush the common iab interface, which would include Amazon IAP.
So here is the first attempt available in the Gideros Labs
http://giderosmobile.com/labs/iabThe idea is to provide common In App Billing interface for most of available iap frameworks, so users could use in app purchases across platforms and iap frameworks with completely same or similar interface.
Currently it supports:
- Ouya (stable)
- Amazon IAP (beta code)
- GoogleBilling v3 (beta code)
- Samsung IAP (alpha code)
- Fortumo IAP (alpha code)
Interface usage is quite simple
- IAB.new(iabframework) -- initialize specified IAB framework
- IAB:setUp(value1, value2, ..., valueN) -- provide all the keys/devids/appids/etc needed for the framework, which you will get in same order on Native part in Map object
- IAB:setProducts({internalId1 = "storeId1", internalId2 = "storeId2", ..., internalIdn = "storeIdn"}) -- provide list of products you will be using (key is your internal products id, value is store specific product id)
- IAB:setConsumables({"internalId1", "internalId2", ..., "internalIdn"}) -- which of your products are consumables, that people can buy many times (provide internal product ids)
- IAB:isAvailable() --check if IAB is available, raises event:
- Event.AVAILABLE --iab is available
- IAB:requestProducts() --request information for products provided in setProducts method
- Event.PRODUCT_COMPLETE
- event.productId
- event.title
- event.description
- event.price
- Event.PRODUCT_ERROR
- IAB:purchase(prodId) --purchase product by providing your internal product id, raises two events:
- Event.PURCHASE_COMPLETE
- event.productId
- event.receiptId
- Event.PURCHASE_ERROR
- iab:restore() --raise purchase events for each previously purchases entitled (not consumed) items, raises two events:
- Event.RESTORE_COMPLETE
- Event.RESTORE_COMPLETE
Any comments feedback, suggestions, which more frameworks to add, etc, welcome
Especially testing is welcomed, really, really, really welcomed
IAB Interface usage matrix and common scenario will come soon.
Comments
https://deluxepixel.com
Likes: SinisterSoft
Likes: phongtt, andrecaribe
Likes: andrecaribe
One thing I have wondered, however, is how your app knows whether it's running on Google, Amazon, Ouya etc. Haven't looked into this in detail - is there already a way of determining this?
and about your second question, it won't know, you will have to do that on your own. Like'in ideal case it would be
To be honest I thought the common billing interface would internally know which one to invoke, otherwise it gets really messy on Android.
This way you could possibly have a single APK that dealt with all stores.
Likes: moopf
https://deluxepixel.com
And there is completely no way to determine from which store the apk was installed on android. It might as well not come from any store.
And besides some frameworks are store independent, like I think Distimo is.
Still I'd say going from completely different code for each store to only different configuration file is a huge step.
https://deluxepixel.com
https://deluxepixel.com
Not sure if that requirement has changed since I last filled one in (last year I think) though.
Apple (Europe) are based outside the US. No W8BEN to enter. Maybe you filled in the form before they started the EU version of Apple.
https://deluxepixel.com
https://deluxepixel.com
Please print, sign with a black or blue pen, then mail your completed W-8BEN form to the following address:
Amazon
Attn: Vendor Maintenance
PO Box 80683
Seattle, WA, 98108-0683
U.S.A.
https://deluxepixel.com
Refined common interface api to match all stores
Amazon Iap passed initial tests
GoogleBilling v3 passed initial tests
Ouya passed initial tests
Updated example and docs to display new api
Added initial support for Samsung IAP
Added initial support for Fortumo IAP
Basically except creating instance, calling setUp to provided needed keys and setProducts to match in app internal product IDs with store specific ids, all other methods are compeltely cross framework compatible and can be used as same code for all stores.
Refer more to provided example with the Gideros Labs download
I currently wait for account aproval on Samsung and Fortumo to test them.
But after that I may even try to develop an auto version discussed before, which would allow to use single apk file for all the stores, based on what is installed on the device it runs (but thats just a theory, and will have a long way of testing to go to that )
http://www.nightspade.com
there are many jar on the plugin:
commons-lang-2.6.jar
FortumoInApp-android-9.0.41.jar
guava-r09.jar
in-app-purchasing-1.0.3.jar
jackson-core-asl-1.8.4.jar
jackson-mapper-asl-1.8.4.jar
ouya-sdk.jar
i think it is safe to remove ouya-sdk.jar and Fortumo, how about the others?
http://www.nightspade.com
Well basically you can remove all of them
FortumoInApp-android-9.0.41.jar is for Fortumo
in-app-purchasing-1.0.3.jar is for Amazon
commons-lang-2.6.jar
guava-r09.jar
jackson-core-asl-1.8.4.jar
jackson-mapper-asl-1.8.4.jar
ouya-sdk.jar are for OUYA
Both Google and Samsung does not have internal libs
Samsung has src\com\sec\android package and src\com\giderosmobile\android\plugins\iab\samsung package
Google Billing has src\com\android\vending\billing package and src\com\giderosmobile\android\plugins\iab\google package
And you can also remove the corresponding interfaces, as IabSamsung, IabAmazon, etc, if you are not going to use them
Played with latest plugin, everything is a breeze
Except there is a bug on Google Billing restore method
on Line 186 of IabGoogle.java
http://www.nightspade.com