In-App Purchases?

thanks a lot
Got both working

Edwin van Poeijer wrote:

Muniraj Sunderavel wrote:
> Hi very much thanks for the reply.
> I got the ios version working.
> There is problem in the android version.
> when i compile the code i get these error in termimal
> undefined reference to `GoogleBilling::Billing::isPurchased(char const*)‘
> undefined reference to `GoogleBilling::Google::disableAds()’
> undefined reference to `GoogleBilling::Google::enableAds()‘
> undefined reference to `GoogleBilling::Billing::isPurchased(char const*)’
> undefined reference to `GoogleBilling::Billing::loadSKUItems(void (*)(int))‘
> undefined reference to `GoogleBilling::Billing::init(void (*)(int))’
> I dont know what i am missing
> Does the project have JNI file for android version.
> As there is no jni binding code in the zip file.
> If so can you please add it to the zip file .
> Thank you in advance
>
The jni code was indeed missing,I’ve added it to the new zip file.

Hi! first of all, thanks for the code. it was very helful.
Looking at the code, i see GoogleBilling::Billing::init()
if i call it, the app crash because GoogleBilling.me is null! i see the method setup that allow to init GoogleBilling.me. Can you tell me when i need to call GoogleBilling::Billing::setup and Where i need to call it? (how can I pass GLSurfaceView?)

Sorry for my poor english!
Thank you very much

You need to call like

GoogleBilling::Billing::init(BillingInitHandler);

in the place where you want to intialize

Muniraj Sunderavel wrote:

You need to call like
>
GoogleBilling::Billing::init(BillingInitHandler);
>
in the place where you want to intialize

Thanks, but I don’t know what parameters I have to pass to GoogleBilling::Billing::setup.
I see in the java file: “public static void setup(Activity me, GLSurfaceView vw)”
what parameters should I pass?
Among other things, I do not see in the file jni_googlebilling the method Billing::setup (while for example i see Billing::init).
Maybe I should call the method “setup” directly from java code (maybe from my Cocos2dxActivity)
I don’t know.
Also, as second problem, if I write
“GoogleBilling::Billing::init(BillingInitHandler);”
I receive this error
“no matching function for call to ‘GoogleBilling::Billing::init()’”
Why?

Sorry and thanks again

GoogleBilling.setup(this, mGLView);

declare this
private static GLSurfaceView mGLView;
before on create.

Make sure the static functions are in the same start of the cpp file

Muniraj Sunderavel wrote:

>

GoogleBilling.setup(this, mGLView);
>
declare this
private static GLSurfaceView mGLView;
before on create.
>
>
2.
Make sure the static functions are in the same start of the cpp file

Thank you very much. Now it works.
Now the problem is: the first time the inapp work very well but if i try to buy an item again, the app crash with the error :another async operation is running…
I think that the previous operation doesn`t close.
Have you notice the same behaviour?

Muniraj Sunderavel wrote:

>

GoogleBilling.setup(this, mGLView);
>
declare this
private static GLSurfaceView mGLView;
before on create.
>
>
2.
Make sure the static functions are in the same start of the cpp file

Thank you very much. Now it works.
Now the problem is: the first time the inapp work very well but if i try to buy an item again, the app crash with the error :another async operation is running…
I think that the previous operation doesn`t close.
Have you notice the same behaviour?

hi
I too have the same problem when inapp for android alone is clicked the second time.
Need to figure out why it happens in android alone.

Muniraj Sunderavel wrote:

hi
I too have the same problem when inapp for android alone is clicked the second time.
Need to figure out why it happens in android alone.

I think it has something to do with trying to purchase an item while there is already an billing in progress.
I had this problem in the beginning in my code but i solved it by disabling the buy buttons while handling the billing.

@Edwin van Poeijer Did you ever write that tutorial for IAP using your code?

I use sooma framework for both android and ios game.
It is not very easy for setup at first time but it is good, i use it in my games

Is the project free to use in commercial games?
Thank you

winipcfg exe wrote:

Is the project free to use in commercial games?
Thank you

Yes, It is free.

Hi There,

Happy to report that SOOMLA now supports Amazon store :slight_smile:

And of course it’s free and open source as always.

http://blog.soom.la/2014/06/soomla-makes-amazon-iap-available-for-game-developers.html