Hello folks,
This is almost the second week that I'm tying to implement IAP in gideros. As I have not made any progress for several days and I've stuck, I've decided to ask for your help.
I have read almost all the guides provided in "
http://docs.giderosmobile.com/interface/iab". As it has said
"IAB Interface provides Completely same workflow for all In-app Billing frameworks", I'm interested in making In-App purchase from a store called
"Cafe Bazaar". The documentations for implementing IAP in this store for native apps is available through
here. As you see it's solution is very very similar to one that "Google Play" uses. I have seen these codes inside the example of how to use IAB:
--[[
initializing store,
will differ for each store
but is mandatory to set
]]
--create iab instance based on store you want to use
iab = IAB.new("test")
--provide key(s) needed for the store
iab:setUp("testkey", "testkey2", "testkey3")
--provide list of products you will be using
--(key is your internal products id, value is store specific product id)
iab:setProducts({p1 = "product1", p2 = "product2", p3 = "upgrade1"})
--which of your products are consumables,
--that people can buy many times (provide internal product ids)
iab:setConsumables({"p1", "p2"}) |
But still I have no idea what to do. Also I have uploaded my game's alpha version in the store and I have the "RSA key" and "Product ID".
I was wondering is there a simple way to implement IAB for such a store? If there is, could someone explain a little bit about the steps of implementing it? And if there is not such a simple approach I wonder can I modify "Google Play"'s implementation and make it work with this store? As I said the solutions for native apps looks very similar, So I'm thinking about something like updating some permissions, intents and key fields and use it for "Cafe Bazaar" store.
Thanks very much for your contribution in advance. (:
Comments
renamre class to IabCafebazaar too
And replace the code of Google Billing to Bazaar billing
Then you can use it from your lua code as
Likes: aimoi
Thank you for your quick response, but sorry I didn't get the last sentence Which I think is the tricky part. What should I exactly replace? I got the all files for "TrivialDrive" example implementing this store IAB. How should I use it and in which files I should make changes in order to configure the interface for implementing the IAB for this store?
Basically, there is no step by step way to do it, but if you say that their system is similar to Google Billing, then probably you can see the similarities between link you provided and your created copy of IabGoogle.java
But basically you need to wrap methods from interface https://github.com/gideros/gideros/blob/master/plugins/iab/source/Android/src/com/giderosmobile/android/plugins/iab/IabInterface.java
Likes: aimoi
well, I think you are definitely familiar with the "TrivialDrive" application that google has provided to show how it's IAP system works. In "Cafe Bazaar" they have used the same example for showing how their system works. They've said: And as you can see inside the commit they have just changed two lines.
In the "AndroidManifest.xml" this:
And now I'm getting the "Unfortunately, Application has stopped" error. I know it could be because of other things so I have started another discussion about that in here.
By the way, according the those very little differences between "Cafe Bazaar" API and "Google play"'s API, can you do me a favor and tell me is there any other thing that I have to change to make the "IabGoogle" framework applicable to be used by Cafe Bazaar?
I really and (seriously) deeply will thank you. (:
I would say it should have been better if you would copy src\com\giderosmobile\android\plugins\iab\frameworks\google folder too and name it cafebazaar and do the needed changes there
and reference this new package from IabCafebazaar.java
this way you would be able to use both google billing and cafebazaar iaps (as in having one single apk for both stores)
About the error, well need to see your logcat output, can't say anything without it, sorry
Likes: aimoi
The LogCat filtered by "System.err" tag and my package name (com.aimdom.aim) is this:
https://deluxepixel.com
In fact I'm trying to implement the IAB from the "Google Play"'s framework. As I've said their API is very similar to google's. So I tried to use the google's freamwork package for this store. I changed it's name to "com.giderosmobile.android.plugins.iab.frameworks.IabCafebazaar" and I updated "IabHelper.java" file inside the package and "AndroidManifest.xml" and (as ar2rsawseen said) I made a copy from "IabGoogle.java" and changed it's name and class name to "IabCafeBazaar.java". What else should I do?
Let me clarify this again: The reason I think I can use the google's API for this store with minimum changes, is that their implementation for "TrivialDrive" (a game developed by google to show how google's IAP API works) is very similar. It's just about changing two lines. Check here.
Did you only rename the file or also renamed the class too?
it clashes with the class name, so app probably does not know which one to load
so I don't think I would be able to delete it. I tried to move the "IabGoogle.java" inside the folder (to prevent potential clashes) but still I have the same problem. It stops working with this in LogCat:
And IabGoogle.java and IabCafebazaar should be in frameworks directory
I tried changing the folder's name and putting back the "IabGoogle.java" in the frameworks directory, too. still having the same problem.
Now I'm not even trying to implement it for "CafeBazaar" as I noticed I can't even implement it for google.
I wonder which part I'm not doing right.
What was @SinisterSoft talking about? should I include some libraries via project properties? I didn't see such a step in the installation part of the guide.
https://deluxepixel.com
So you mean I should add "Google play services" to my application via it's properties/add library tools to be able to run my app with plugin?
https://deluxepixel.com